Finding Optimal Number Of Clusters for Kmeans
45 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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?
0 comentarios
Respuestas (2)
Taro Ichimura
el 1 de Jun. de 2016
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
el 19 de Jun. de 2022
Refer "evalclusters" function
eva = evalclusters(X,'kmeans','CalinskiHarabasz','KList',1:6);
Optimal_K = eva.OptimalK;
1 comentario
Walter Roberson
el 19 de Jun. de 2022
Editada: Walter Roberson
el 23 de Jun. de 2022
And see https://www.mathworks.com/matlabcentral/answers/52322-how-to-determine-number-of-clusters-automatically-for-each-image-to-be-used-in-k-means-algorithm#comment_2222525 for why evalclusters is mostly arbitrary with not so much real use.
Real mathematics says that every unique point should be its own cluster.
Ver también
Categorías
Más información sobre Cluster Visualization and Evaluation en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!