error occurred while executing a kmeans function
Show older comments
Error using kmeans/batchUpdate (line 376) Empty cluster created at iteration 1.
Error in kmeans (line 280) converged = batchUpdate();
Error in testing1 (line 28) [cr,ccr] = kmeans(R,10) the above error occurred while executing a program for kmeans clustering. kindly help me out.
4 Comments
the cyclist
on 10 Mar 2014
It is essentially impossible to diagnose this without seeing your code.
Can you provide the smallest possible code (and data) that will replicate this issue? Oftentimes, doing this may help you discover the problem yourself.
dpb
on 10 Mar 2014
Not enough info...most likely it's a data input problem that doesn't have sufficient numbers to allow for 10 clusters or the data is so tightly grouped that many of the requested 10 are empty even if appears to be sufficient DOF overall.
That the message is "Empty cluster" on first iteration makes one or the other (or both) of the above likely imo...
Cut down the number of clusters requested altho would likely do well to use scatter or some other visual tools to visualize the data prior to just blindly asking kmeans to do its thing...
chethan
on 18 Mar 2014
Walter Roberson
on 20 Mar 2014
Look at the documentation page, at the 'emptyaction' option.
Answers (0)
Categories
Find more on k-Means and k-Medoids Clustering in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!