Question about Kmeans function
이전 댓글 표시
Anyone can explain this, please?
[IDX,C] = kmeans(X,k,param1,val1)
here, 'start' is as param1, Matrix is as val. It is the method used to choose the initial cluster centroid positions.
Matlab help exaplained as: "k-by-p matrix of centroid starting locations. In this case, you can pass in [] for k, and kmeans infers k from the first dimension of the matrix."
Here is function I try to use: [IDX,C]=kmeans(data,[],'Distance','sqEuclidean','emptyaction','singleton','Start',data);
Question 1: is "data" that Matrix which help talked about? Question 2: if it is, the new problem coming as below "??? Error using ==> NaN Out of memory. Type HELP MEMORY for your options.
Error in ==> kmeans at 298 if online, Del = NaN(n,k); end % reassignment criterion"
In my case, dimension of data is 334795x2.
채택된 답변
추가 답변 (3개)
Tom Lane
2011년 3월 31일
You have written
kmeans(data,[],'Distance','sqEuclidean','emptyaction','singleton','Start',data)
You don't want to specify "data" as both the input data and the starting guess at the centroid locations. Suppose you want kmeans with k=7. You want the 'Start' value to have 7 rows, one for each centroid.
Elad
2013년 7월 5일
0 개 추천
카테고리
도움말 센터 및 File Exchange에서 k-Means and k-Medoids Clustering에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!