Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

New to MATLAB?

rectify error in kmeans

Asked by Elysi Cochin

Elysi Cochin (view profile)

on 12 Jan 2013

i wanted to do kmeans clustering in mammogram image.... i took the datavector of the image and gave as input to kmeans.... when i execute the code error is displayed as...."An empty cluster error occurred in every replicate.".... what should i do to rectify this error....

0 Comments

Elysi Cochin

Elysi Cochin (view profile)

Tags

Products

No products are associated with this question.

2 Answers

Answer by Tom Lane

Tom Lane (view profile)

on 14 Jan 2013
Accepted answer

The kmeans function has an option 'EmptyAction' that you could try. With this option you can request that, if a cluster becomes empty, the function either accept a smaller number of clusters or create a new one from a point that is relatively far from the others.

1 Comment

Elysi Cochin

Elysi Cochin (view profile)

on 16 Jan 2013

thank u sir....

Tom Lane

Tom Lane (view profile)

Answer by Greg Heath

Greg Heath (view profile)

on 13 Jan 2013

Reduce k by 1.

Hope this helps.

Thank you for formally accepting my answer.

Greg

1 Comment

Elysi Cochin

Elysi Cochin (view profile)

on 14 Jan 2013

no sir i didnt get it.... still that error....

Greg Heath

Greg Heath (view profile)

Contact us