automatic kmeans: choosing the number of clusters automatically?

Hi, I was wondering if there is a way in matlab to do automatic kmeans clustering where the number of clusters K is choosen automtically instead of being user defined? Thanks

4 件のコメント

Sven
Sven 2012 年 8 月 23 日
So what are your requirements to choose the number of clusters?
I can write a function that "automatically" chooses the number of clusters to be 10:
chooseNumClusters = @()10;
Now you might have a data set where 10 is the wrong number to choose. What you need to do is describe why you feel that 10 (or any other number) would be wrong.
jenka
jenka 2012 年 8 月 27 日
well, that is the whole point. I would like to go into kmeans without me suggesting how many clusters to use. Let the programs decide in some optimatl fashion.
Image Analyst
Image Analyst 2012 年 8 月 27 日
And the link I gave below was of no help? Well, search around... because I think I remember earlier this year there was some talk about methods that tried to guess at the best number of clusters to use.
snigdha priya Bommadevara
snigdha priya Bommadevara 2012 年 10 月 30 日
I am trying to determine the number of clusters automatically i.e the value of k automatically depending upon the image details. I have used the VAT alorithm combined with EDBE algorithm to find k and it did not work properly for my large of large array size. Can anyone help me out with the pseudo code for the algorithm to find automatically the number of clusters proposed by Dr.James Bezdek.

サインインしてコメントする。

回答 (2 件)

kira
kira 2019 年 5 月 2 日

3 投票

old question, but I just found a way myself looking at matlab documentation:
klist=2:n;%the number of clusters you want to try
myfunc = @(X,K)(kmeans(X, K));
eva = evalclusters(net.IW{1},myfunc,'CalinskiHarabasz','klist',klist)
classes=kmeans(net.IW{1},eva.OptimalK);
Image Analyst
Image Analyst 2012 年 8 月 23 日

0 投票

2 件のコメント

huda nawaf
huda nawaf 2014 年 12 月 20 日
*hi,
I used the code of NCestimation_v2 but got this error message
??? Undefined function or variable 'classlabel'.
Error in ==> validity_Index at 5 labels = classlabel;
I used my data with that code
data=dlmread('d:\matlab\r2011a\bin\paper_comm\link_flixster_bin1.txt');
c=kmeans(f1,2);
  • I do not know what classlabel should be
Thanks
Image Analyst
Image Analyst 2014 年 12 月 20 日
Sorry, I don't know what NCestimation_v2 is, and I don't have the Statistical Toolbox so I don't have kmeans ().

サインインしてコメントする。

質問済み:

2012 年 8 月 23 日

回答済み:

2019 年 5 月 2 日

Community Treasure Hunt

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

Start Hunting!

Translated by