matlab - Clustering: Error for "Lose" its Member During Initial. Possible? -


i'm working k-means in matlab gui. have done it. program (gui) works quite fine (in command window, works perfectly). don't know, gui working, error appears suddenly. here error message:

??? error while evaluating uicontrol callback  ??? error using ==> kmeans>batchupdate @ 436 empty cluster created @ iteration 1.  error in ==> kmeans @ 337         converged = batchupdate();  error in ==> calcrand @ 4 [g c] = kmeans(data,k,'dist','sqeuclidean');  error in ==> kmeansfin2>centroid_callback @ 203     [g,c,y,clr]=calcrand( data,k );  error in ==> gui_mainfcn @ 96         feval(varargin{:});  error in ==> kmeansfin2 @ 42     gui_mainfcn(gui_state, varargin{:});  error in ==> @(hobject,eventdata)kmeansfin2('centroid_callback',hobject,eventdata,guidata(hobject))   ??? error while evaluating uicontrol callback 

a little explanation: gui has 4 push buttons, cluster, show centroid, show graphic, evaluate graphic. give code here, long, give hint of codes:

% cluster (push button) [g c] = kmeans(cobat,k,'dist','sqeuclidean'); y = [cobat g]  % show centroid (push button) c  % evaluate cluster [s,h]=silhouette(cobat,g,'sqeuclidean');  % show graphic %# show points , 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') 

according error, said that, "it possible cluster "lose" of members during initial phase of clustering; that's how k-means algorithm works. usual reason why happens bad choice of starting cluster centroids. 'emptyaction' parameter controls steps taken if happen, , default error out." right? can explain me trusted sources? , there way stay away error?

thank you.

yes, it's possible during k-means algorithm 1 cluster can lose members. can happen @ stage of algorithm; cause initial cluster centroids poorly chosen, , in case it's occur @ stage of algorithm.

matlab's kmeans algorithm has parameter emptyaction specifies should done in case. emptyaction can set error (default), drop (in case cluster dropped , corresponding return values set nan) or singleton (in case new cluster created single point furthest centroid).

choosing either drop or singleton should allow algorithm proceed completion, should still aware may case initial centroids poorly chosen, in case should try address that.

documentation kmeans


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -