# Understanding clusters after applying PCA then K-means

I have a dataset grouped by customer level, and the rows are sum_mexico, sum_uk, ... etc to indicate if the customer has spent money at stores in those countries..similarily counts for these as well. I end up with 200 columns.

I would like to cluster this data to observe the spending habits and see if i can group them by these features. I'm unsure what clustering method would be best but i would like to provide meaningful results to business.

I've read about using PCA then k-means. E.G. you can carry out K-means on your Principcal componenets. What i don't understand is how i can then interpret the results. e.g. say i have the below situation from https://365datascience.com/tutorials/python-tutorials/pca-k-means/:

i can visually see 4 clusters, but how can i get the characteristics of each cluster.. What can i say about cluster 1 for example, are they charactertized by high spend in mexico ? (assuming i got these results myself using my own data and steps from link!) My end goal is to understand what charcterizes each cluster e.g. it may be that certain customer IDS have high spends in spain and wine etc.

## 1 Answer

PCA removes the connection with the original features,so the interpretation of the visualisations in the principle component space is therefore not very meaningful.

E.g. cluster A has higher values of PC1, where cluster B has higher values of PC2.

If you can clearly see that PC1 is only representative of Feature X, then fine, but this isn't often the case.

Instead use PCA to discover which features best represent the data, and use this to remove unnecessary (unrepresentative) features so that you can visualise the original data using its most important original features. And therefore describe the clusters with meaningful differences.

You might want to experiment with a scatter matrix, to explore which features spaces have the cleanest distinction between clusters.

• how would i see if PC1 is representative of feature X? How can i use PCA to see what features best represent the data when it combines them all .. could you point me to a resource where they do this? I have not used PCA in this context. I am using python Apr 15 at 17:10
• you can use this to get the feature by component matrix pd.DataFrame(pca.components_, columns=list(df.columns))
– WBM
Apr 15 at 17:16
• And some further reading here towardsdatascience.com/…
– WBM
Apr 15 at 17:18
• are there any others ways to see what features i should use for clustering? Apr 15 at 20:36
• You should start a different question for this
– WBM
Apr 16 at 10:08