Why does KMEANS return different results when invoked on the same input?
Afficher commentaires plus anciens
When I run the following code multiple times, KMEANS returns different partitions (and hence a different vector s of within-cluster sums of point-to-centroid distances) although the data matrix a is the same:
a = [0 -1 0 2 0]
[b c s] = kmeans(a,2,'distance','cityblock')
Output 1:
b =
2
2
2
1
2
c =
2
0
s =
0
1
Output2:
b =
2
1
2
2
2
c =
-1
0
s =
0
2
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Cluster Analysis and Anomaly Detection dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!