Filter löschen
Filter löschen

kmeans

3 Ansichten (letzte 30 Tage)
yoga z
yoga z am 30 Apr. 2012
Bearbeitet: Kawther am 30 Nov. 2014
Hi there,
how to write the plot if i use 4 cluster like this:
X = [randn(100,2)+ones(100,2);... randn(100,2)-ones(100,2)]; opts = statset('Display','final'); [idx,ctrs] = kmeans(X,4,... 'Distance','city',... 'Replicates',5,... 'Options',opts); plot(X(idx==1,1),X(idx==1,2),'r.','MarkerSize',12) hold on plot(X(idx==2,1),X(idx==2,2),'b.','MarkerSize',12) [plot ....] [plot ....]
thank you

Akzeptierte Antwort

Wayne King
Wayne King am 30 Apr. 2012
You do the same thing except:
plot(X(idx==1,1),X(idx==1,2),'r.','MarkerSize',10);
hold on
plot(X(idx==2,1),X(idx==2,2),'b.','MarkerSize',10);
plot(X(idx==3,1),X(idx==3,2),'g.','MarkerSize',10);
plot(X(idx==4,1),X(idx==4,2),'k.','MarkerSize',10);
  2 Kommentare
Isabella Osetinsky-Tzidaki
Isabella Osetinsky-Tzidaki am 30 Apr. 2012
add
>> hold off
yoga z
yoga z am 5 Jun. 2013
thank u very much for your answer

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Kawther
Kawther am 30 Nov. 2014
Bearbeitet: Kawther am 30 Nov. 2014
Thank you Wayne King. I did get benefit from your code. i want to ask please about finding the bet error rate for such a code. How can i determine the decision regions, so that i can then find the bet error rate?
Can i consider the originally sent data as a training data and resend data again and consider it and a test data and use them to find the bet error rate?
Thank you very much. Kawther Hamad,

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by