Finding Optimal Number Of Clusters for Kmeans

I want to find the number of clusters for my data for which the correlation is above .9. I know you can use a sum of squared error (SSE) scree plot but I am not sure how you create one in Matlab. Also, are there any other methods?

답변 (2개)

Taro Ichimura
Taro Ichimura 2016년 6월 1일

0 개 추천

Hello,
you have 2 way to do this in MatLab, use the evalclusters() and silhouette() to find an optimal k, you can also use the elbow method (i think you can find code in matlab community) check matlab documentation for examples, and below
% example
load fisheriris
clust = zeros(size(meas,1),6);
for i=1:6
clust(:,i) = kmeans(meas,i,'emptyaction','singleton',...
'replicate',5);
end
va = evalclusters(meas,clust,'CalinskiHarabasz')
Pamudu Ranasinghe
Pamudu Ranasinghe 2022년 6월 19일

0 개 추천

Refer "evalclusters" function
eva = evalclusters(X,'kmeans','CalinskiHarabasz','KList',1:6);
Optimal_K = eva.OptimalK;

댓글 수: 1

Walter Roberson
Walter Roberson 2022년 6월 19일
편집: Walter Roberson 2022년 6월 23일
Real mathematics says that every unique point should be its own cluster.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Statistics and Machine Learning Toolbox에 대해 자세히 알아보기

태그

질문:

2014년 8월 26일

편집:

2022년 6월 23일

Community Treasure Hunt

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

Start Hunting!

Translated by