k-means algorithm: start and replicates parameters

13 ビュー (過去 30 日間)
Natasha Kratowska
Natasha Kratowska 2012 年 3 月 9 日
Hello,
I am using the k-means to cluster a set of data stored in a 300x20 matrix called "Data1".
The predifened centers are stored in a 10x20 matrix called "centers1".
Here is the code:
[cidx,ctrs,sumd,D]=kmeans(Data1,10,'dist','sqEuclidean','emptyaction','drop','rep',500,'start',centers1,'disp','final');
I get the following message:
_The third dimension of the 'Start' array must match the 'replicates' parameter value_
Any help?
Thank you very much.
Natasha

採用された回答

Tom Lane
Tom Lane 2012 年 3 月 9 日
The 'start' parameter defines the starting centroids. The 'replicates' parameter indicates how many times to repeat the clustering. You only gave one set of starting values, so it doesn't know what to make of that. I can imagine two things:
If you want to start at centers1 once, and at a random value the other 499 times, try running with 'start',centers1 once and then 'rep',499.
You could have intended to start at centers1 500 times, and you could if you specify the 'start' value as repmat(centers1,[1 1 500]). But I don't think there is any randomness built into the algorithm after the selection of starting values, so I don't think this would help.

その他の回答 (0 件)

カテゴリ

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