MATLAB Answers


k means clustering: Classifying subsequent to a particular cluster - can it be done?

Asked by John
on 16 Nov 2011

Hi there,

I have question in relation to k means clustering. Say I created two clusters from data. For example using this code:

X = [randn(100,2)+ones(100,2);...
opts = statset('Display','final');
[idx,ctrs] = kmeans(X,2,...
hold on
legend('Cluster 1','Cluster 2','Centroids',...

My question is, if you collect more data can you assign it to each of the two clusters that have already been formed, or do you have to cluster all of the data again?

If it is possible, how would you do it?

Thank you



No products are associated with this question.

1 Answer

Answer by Wayne King
on 16 Nov 2011

k-means is an unsupervised learning algorithm that is sensitive to the number of clusters you choose AND to the initial start centers. I would say that you would need to cluster the data again.


Join the 15-year community celebration.

Play games and win prizes!

Learn more
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

MATLAB Academy

New to MATLAB?

Learn MATLAB today!