Why kmeans gives different results each time?
39 views (last 30 days)
* *I have square binary similarity matrix show the social relation among users, where o means no relation between two users and 1 means there is relation between them.
I used kmeans to do clustering*
When run the kmeans more than one times, the results are different.
for example at firs time the cluster 1= 4448 users , cluster 2= 434, and cluster 3=118
But, in second times cluster 1= 4880 users , cluster 2= 119, and cluster 3=1
Why the results are different??*
More Answers (1)
Chetan Rawal on 18 Dec 2014
As John mentioned, the clustering happens by starting at random points, automatically selected by the algorithm. That is why in such a optimization/machine learning problems, you should try multiple iterations and use a validation data set if possible. To get the results closer between different runs, you can try to:
- Increase number of iterations by increasing 'MaxIter'
- Use your own starting points with the 'start' name-value pair
Starting with your own seeds instead of randomly selected seeds by MATLAB will ensure a consistent answer.