Cross Validated is a question and answer site for people interested in statistics, machine learning, data analysis, data mining, and data visualization. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Recently I have come across usage of cluster plot, which combines k-mean clustering along with PCA. The plot shows different clusters plotted using first two PCs. I have checked some of the threads (here and here) regarding the usage.

I want to know, during generating a cluster plot, does the data is clustered first and then PCA is done, or the reverse way (PCA followed by k-mean clustering)?

Because the second link says PCA is done followed clustering. But in the first link where an example is shown to generate a cluster plot, data is clustered first and then the cluster plot is generated.

Regarding interpretation, does the plot has to be interpreted as the number of clusters generated or are there any extra points to interpret?

share|improve this question
How do you imagine cluster->PCA->plot path to yourself? – ttnphns Apr 8 '14 at 10:10
up vote 4 down vote accepted

It is hard to see how you could do PCA on clusters; it is quite common to do PCA prior to clustering, particularly when you have a lot of variables. You can then use the PCs as variables.

You might be getting confused between a different two alternatives:

1) Do PCA on the data, then do k-means on the PCs, then plot the results

2) Do k-means on the data, do PCA on the data, then plot the clusters in terms of means on the PCs.

Both of these seem reasonable to me; the first may be better when there are many variables or when k-means on the data doesn't yield anything useful.

The former condenses the data in order to do cluster analysis. The latter condenses the data in order to visualize cluster analysis.

share|improve this answer
Thank you very much for nice explanation. I was confused between these two alternatives. Second option is what I was thinking. It is mainly for visualization. – poison Alien Apr 8 '14 at 10:53
What did you mean by "plot[ting] the clusters in terms of means on the PCs"? I guess one could do clustering first, then do PCA, and then make a scatter-plot of the data points in PC1-PC2 coordinates, coloring each dot according to its cluster (that was identified before PCA). Seems like a feasible option to me. – amoeba Dec 29 '14 at 1:19
Yes that's what I meant. You could also do other pairs of PCs – Peter Flom Dec 29 '14 at 11:22

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.