Why does KMEANS return different results when invoked on the same input?
Ältere Kommentare anzeigen
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
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Cluster Analysis and Anomaly Detection finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!