Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1 Clustering Algorithm In this assignment you will implement simplified version of l-means algorithm using Python to cluster a toy dataset comprising tive data points

image text in transcribed
1 Clustering Algorithm In this assignment you will implement simplified version of l-means algorithm using Python to cluster a toy dataset comprising tive data points into two clusters. It is not necessary that you shoukl be ware of clastering algorithms to complete this task. The steps involved to build the clustering algorithm in this task is provided below. You are required to implement the described steps in Python to build the algorithm. You can complete this task by using functions and for loops in Python More specifically, consider the following dataset comprising five data points (2-dimensional) (0,0).1,0.1.1),(0,1),(-1,0)) The steps involved in developing the clustering algorithm are as follows: 1. Step 1: Choose the number of controls (data points) required to create clusters. Since we need to create two cisters, we select two centro de Specifically in this assignment, we will choose - (1.0) and - (1.1). We will call and as our two initial clusters with centrode (1.0) and (1.1) 2. A clustering algorithm testually involves a set of iterations to go through the data points sal times before creating the clasters. In this simple task, we will have only two iterations to go through the data points. Remember one iteration ivolves processing each of the data points once. You are required to do the following in the first and second iteration as described below 3. Ist Iteration . compute distance between each data point in the dataset and the centroids in both clusters which we have ittilised in Step 1 add the data point to the chester that has minimum distance from a given centroid in the cluster. To compite the distance, define a function that takes two points as arguments and compute the distance between the postering the equation: dV-1+(2-0) at the end of first iteration, you will have a set of points clustered in each of the clusters based on the distance between centrold. The total set of points in both the clusters will be five Compute the mean of the net of points in each cluster. To do so, define a fimction that takes in a set of points and returns the mean of the set of points, puwed as arguments to the function reinitialise the clusters and c with the mean values, 4. 2nd Iteration . repeat the same steps that you performed during the first iteration to go through each data point to compute the distance between each data point and the new mean values obtained in the first iteration at the end of 2nd iterations, you will have once again have two chasters with a set of points clustered together. The total set of points in both the clusters will remain five . At the end of second iteration, when you compute the mean, you will notice that the mean values have not changed. This means that you have successfully clustered the five data points into two clusters

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Spomenik Monument Database

Authors: Donald Niebyl, FUEL, Damon Murray, Stephen Sorrell

1st Edition

0995745536, 978-0995745537

More Books

Students also viewed these Databases questions

Question

Explain all drawbacks of application procedure.

Answered: 1 week ago

Question

Explain the testing process of accounting 2?

Answered: 1 week ago