Determination of data points in each cluster of K-means algorithm

1 回表示 (過去 30 日間)
Haresh Kumar
Haresh Kumar 2019 年 9 月 4 日
回答済み: Adam 2019 年 9 月 4 日
Hello,
How can I calculate the number of data points of each cluster of K-means ? I found the answer of counter in python, but donot know how to use such kind of commond in MATLAB. I am finding clusters using this code.
[idx,C]
=kmeans(score,3);
figure
gscatter(score(:,1),score(:,2),idx,'bgm')
hold on
plot(C(:,1),C(:,2),'kx', 'MarkerSize',25)
Br,
Haresh Kumar

回答 (1 件)

Adam
Adam 2019 年 9 月 4 日
accumarray( idx, 1 );

カテゴリ

Help Center および File ExchangeStatistics and Machine Learning Toolbox についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by