MATLAB Answers

0

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

Asked by Haresh Kumar on 4 Sep 2019
Latest activity Answered by Adam
on 4 Sep 2019
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

  0 Comments

Sign in to comment.

1 Answer

Answer by Adam
on 4 Sep 2019

accumarray( idx, 1 );

  0 Comments

Sign in to comment.