Note that there are some explanatory texts on larger screens.

plurals
  1. POClustering: Error for "Lose" its Member During Initial. Possible?
    primarykey
    data
    text
    <p>I'm working with k-means in MATLAB GUI. I have done with it. The program (GUI) works quite fine (in command window, it works perfectly). I don't know, sometimes the GUI is working, but sometimes the error appears suddenly. Here is the error message:</p> <pre><code>??? Error while evaluating uicontrol Callback ??? Error using ==&gt; kmeans&gt;batchUpdate at 436 Empty cluster created at iteration 1. Error in ==&gt; kmeans at 337 converged = batchUpdate(); Error in ==&gt; CalcRand at 4 [g c] = kmeans(data,k,'dist','SqEuclidean'); Error in ==&gt; kmeansFIN2&gt;Centroid_Callback at 203 [g,c,y,clr]=CalcRand( data,k ); Error in ==&gt; gui_mainfcn at 96 feval(varargin{:}); Error in ==&gt; kmeansFIN2 at 42 gui_mainfcn(gui_State, varargin{:}); Error in ==&gt; @(hObject,eventdata)kmeansFIN2('Centroid_Callback',hObject,eventdata,guidata(hObject)) ??? Error while evaluating uicontrol Callback </code></pre> <p>A little explanation: My GUI has 4 push buttons, they are Cluster, Show Centroid, Show the Graphic, Evaluate the Graphic. I could give my code here, but it is too long, so I just give a hint of my codes:</p> <pre><code>% CLUSTER (PUSH BUTTON) [g c] = kmeans(cobat,k,'dist','SqEuclidean'); y = [cobat g] % SHOW CENTROID (PUSH BUTTON) c % EVALUATE THE CLUSTER [s,h]=silhouette(cobat,g,'SqEuclidean'); % SHOW THE GRAPHIC %# show points and clusters (color-coded) clr = lines(k); figure, hold on scatter3(cobat(:,1), cobat(:,2), cobat(:,3), 36, clr(g,:), 'Marker','.') scatter3(c(:,1), c(:,2), c(:,3), 100, clr, 'Marker','o', 'LineWidth',3) hold off view(3), axis vis3d, box on, rotate3d on xlabel('x'), ylabel('y'), zlabel('z') </code></pre> <p>According to the error, someone said that, "It is possible for a cluster to "lose" all of its members during the initial phase of clustering; that's just how the K-Means algorithm works. The usual reason why this happens is a bad choice of starting cluster centroids. The 'EmptyAction' parameter controls what steps are taken if it does happen, and the default is to error out." Is it right? Can someone explain me with trusted sources? And is there way to stay away from this error?</p> <p>Thank you.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload