1
18kviews
What is clustering? Explain k-means clustering algorithm.
1 Answer
written 8.4 years ago by | modified 8.4 years ago by |
k-means algorithm:
Do the same process till no element is moving from one cluster to another.
Algorithm:
k: number of clusters
n :sample features vectors $x_1, x_2………x_n$
$m_i$: the mean of the vectors in cluster i
Assume k<n< p="">
Make initial guesses for the mean m_1 , m_2……..,m_k
Until there is no changes in any mean
Use the estimated means to classify the samples into clusters.
For I from 1 to k
Replace m_i with the mean of all of the samples for cluster i
End _until
Suppose the data for clustering – 2,4,10,12,3,20,11,25