calculate centroid after kmeans
1 view (last 30 days)
Show older comments
Hi,
Is it possible to retrospecively compute the centroids from the membership indices and the data after running kmeans?
Thanks!
Hans
0 Comments
Answers (1)
Image Analyst
on 1 Mar 2020
Why not simply use the centroid locations that kmeans returns to you? Did you know that kmean() returns those if you ask for (accept) two return values
[indexes, centroids] = kmeans(data, k);
See Also
Categories
Find more on Statistics and Machine Learning Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!