output of k means clusters "idx"
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
idx = kmeans(X,k)
idx means what ? i read description of function but i still confused
how i can use it
if i need to know the output of each cluster without plot
like cluster 1(4,6,7)
cluster 2(5,7,9)
0 commentaires
Réponse acceptée
Walter Roberson
le 17 Juil 2019
idx will be a vector which has as many entries as there are rows in X.
The j'th entry, idx(j) tells you the cluster number that X(j,:) belongs to.
which_in_cluster = cell(k,1);
for j = 1 : k
which_in_cluster{j} = find(idx == j);
end
Now which_in_cluster will be a cell array in which the j'th entry is a vector indicating which rows were part of the j'th cluster.
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Cluster Analysis and Anomaly Detection dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!