Question

I have a 2400x12 data which I would like to classify using kmeans. Can anybody tell me how I can see the output of kmeans? Thanks.

Was it helpful?

Solution

As the other guy said, you can't 'see' 12 dimensions. However, you may be able to use PCA to deal with that (check PCA in wikipedia). Assuming that the data variable is called Data:

[c, s] = princomp(Data);
plot(s(:,1), s(:,2),'.');

The rows in s are related to the rows in Data, so you can plot using different symbols for different clusters. For instance:

U=kmeans(Data,2);
[c, s] = princomp(Data);
plot (s(U==1,1), s(U==1,2), 'x');
hold on;
plot (s(U==2,1), s(U==2,2), '*');
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top