Clustering Methods K- means
K-means Algorithm
Assume that K=3 and initially the points are assigned to clusters as follows. C 1 ={x 1,x 2,x 3 }, C 2 ={x 4,x 5,x 6 } and C 3 ={x 7,x 8 }. Apply the K-means algorithm until convergence.(i.e. untill the clusters do not change), using the manhattan distance. Problem Statement
Given data X1=(1,9) X2=(1,2) X3=(9,5) X4=(4,7) X5=(10,6) X6=(7,5) X7=(2,3) X8=(4,8)
K-means The initial centroids are C 1 ={x 1,x 2,x 3 } C 2 ={x 4,x 5,x 6 } C 3 ={x 7,x 8 }
K-means Manhattan distance Distance calculation:
Iteration 1 The table shows the distance between the object and centroids
Iteration 1 New centroids
Iteration 2 The table shows the distance between the object and new centroids
Iteration 2 New centroids
Interation 3 The table shows the distance between the object and new centroids
Iteration 3 New centroids
Results At this stage centroid remains same. The K-means algorithm converges here. Thus the final centroids are ◦ C 1 =(3,8) ◦ C 2 =(8.67,5.33) ◦ C 3 =(1.5,2.5)
Results