error occurred while executing a kmeans function

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 个评论

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.
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...
the problem was with the data supplied for kmeans clustering. thank u sir.
Look at the documentation page, at the 'emptyaction' option.

请先登录,再进行评论。

回答(0 个)

标签

Community Treasure Hunt

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

Start Hunting!

Translated by