フィルターのクリア

k-means clustering: save the number of iterations in a matrix

5 ビュー (過去 30 日間)
pavlos
pavlos 2014 年 1 月 31 日
回答済み: Phu Lai 2016 年 12 月 8 日
Hello,
With the following command the number of iterations are displayed in the Command Window.
idx = kmeans(X,30,'display','iter');
iter phase num sum
1 1 365 40.9896
2 1 60 37.0645
3 1 18 36.001
4 1 3 35.7457
5 1 1 35.6472
6 2 39 34.8684
7 2 32 34.1611
8 2 16 33.7392
9 2 11 33.3268
10 2 4 33.2144
11 2 1 33.2046
11 iterations, total sum of distances = 33.2046
Is there a way to save the displayed number of iterations and the total sum of distances in a matrix stored in the Workspace?
Thank you. Best,
Pavlos

採用された回答

David Sanchez
David Sanchez 2014 年 1 月 31 日
[IDX,C,sumd,D] = kmeans(X,30,'display','iter');
where
sum(sumd)
is the sum of distances The number of iterations is not stored in any variable

その他の回答 (1 件)

Phu Lai
Phu Lai 2016 年 12 月 8 日
Another way around to get the number of iterations is modifying the kmeans.m source code :)

カテゴリ

Help Center および File ExchangeCluster Analysis and Anomaly Detection についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by