Dataset transformation for clustering after PCA I have conducted PCA that has reduced the dimensions of my data from more than 20 to 7 (7 PCAs explain about 85% of the total variation). As a second step, I have to cluster my data based on these new 7 PCAs.
My question is: how I should reconstruct/transform my data (cbind/rbind)? As I understand, each PCA is a weighted mix of the original variables. So should I just replace the old variables with the PCAs?
Also, how should I interpret the final results? If there was no PCA, each cluster would incorporate all variables in some proportion. But after PCA, how would I describe each cluster? For instance, cluster 1 contains 40% of PCA 1 and PCA 1, in turn, has xxx loading scores? Something like this? Would greatly appreciate any help on interpreting this.
 A: Yes, the PCA loadings components represent the "contribution" of each original variable. These can be positive (same direction) or negative (opposite direction).
Then you perform the clustering using the PCA scores as new variables. You can estimate which of the PCA components contribute more to each cluster in multiple ways (feature importance, statistical test, etc.).
Then you can infer the contribution of the original variables to each cluster, by looking at the weights of the PCA loadings corresponding to components found in the previous step.
This interpretation is quite arbitrary because, as said, the loadings are a combination of all variables with large or small weights. One simple strategy is to rank the weights based on their absolute values and extract the top $N$ variables. Then you can see each loading as approximately dependent on these variables.
A: You are suggesting you are using R. So here is an example for PCA and Kmeans clustering on toy data.
d = mtcars
d2 = prcomp(d, scale=T)
x =d2$x[,1:2]
y = kmeans(x,2)
y$cluster
plot(x,col=y$cluster,cex=0.1)
text(x,row.names(mtcars),col=y$cluster)

In this example, the original data has 11 features, and we reduce them into 2 and run kmeans clustering to cluster the data into 2 clusters.
To summarize the code:

*

*We have 32 data points (32 cars), and 11 features (car's weight, cylinders etc.), and we convert it into another data matrix X that also has 32 rows, but 2 features.


*These 2 features are linear combinations of original feature, and do not have a clear physical meaning.


*When we run clustering, we are still clustering these 32 cars based on new transformed feature.


*The clustering results shows the cars are similar to each other in transformed feature space. So, if we lose a lot of information in PCA, we cannot say the cars in the same cluster are similar to each other (in original space).
Here is an example to tell what is each cluster: we check the data in one cluster and find the commonalities in original space. For example, In this cars clustering, we can tell the red cluster has the cars that are more heavy, more cylinders and less mpg.
(The clustering is basically a split on PC1, and we can check the loadings to see what is PC1 made of)

