필터 지우기
필터 지우기

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 CenterFile Exchange에서 Cluster 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