Kmeans returns negative values in cluster centroids?
5 views (last 30 days)
Show older comments
I am performing kmeans on a dataset , with 500 points and 1000 dimensions. The dataset is a histogram, where each dimension is a positive integer value. I manually provide the initial class centroids. I have defined the kmeans as:
if true
opts = statset('MaxIter', 50);
[C, cluster_centroids] = kmeans(data,[],'start',centroids,'options',opts,'emptyaction','drop')
end
But the cluster centroids has negative values in it. I don't understand how since for kmeans while updating the centroids for each iteration , it just takes the average of the data points. Since all the values are positive , how can you have negative averages. Am i missing something?
Thanks, Eric
0 Comments
Answers (0)
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!