running k-means and getting different results run after run?
10 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
cgo
il 17 Ago 2018
Commentato: Mehmet Volkan Ozdogan
il 2 Apr 2019
I am running k-means clustering algorithm on a data, and I don't understand why I am getting different silhouette plots each time I run this. Is there a way to stabilise this? (or set the number of iterations) so I get the same results?
3 Commenti
Risposta accettata
Image Analyst
il 17 Ago 2018
That's normal. Specify 'Replicates' to get convergence.
% Do kmeans clustering on the gray scale image.
grayLevels = double(grayImage(:)); % Convert to column vector.
[clusterIndexes, clusterCenters] = kmeans(grayLevels, numberOfClusters,...
'distance', 'sqEuclidean', ...
'Replicates', 2);
labeledImage = reshape(clusterIndexes, rows, columns);
See attached demo.
3 Commenti
Image Analyst
il 27 Mar 2019
You forgot to attach 'ucd1.xlsx', or even any scatterplots. Please do so, so we can help you.
Mehmet Volkan Ozdogan
il 2 Apr 2019
Più risposte (0)
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!