running k-means and getting different results run after run?
12 ビュー (過去 30 日間)
古いコメントを表示
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?
採用された回答
Image Analyst
2018 年 8 月 17 日
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 件のコメント
Image Analyst
2019 年 3 月 27 日
You forgot to attach 'ucd1.xlsx', or even any scatterplots. Please do so, so we can help you.
Mehmet Volkan Ozdogan
2019 年 4 月 2 日
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!