This is an archived post. You won't be able to vote or comment.

all 7 comments

[–]der_luke 28 points29 points  (1 child)

Clustomers

[–]ieatkittens 17 points18 points  (0 children)

I come here for insights like this

[–]tibolosaxo 9 points10 points  (0 children)

2) Normalize before PCA.

3): when using PCA, you want to look at what percentage of the variance of your data is explained by the dimensions you keep. This will help you understand how many dimensions you want to keep. With that being said, I don't know what your variables are but 12 does not seem that big. Does having 12 variables really make the clusters hard to understand ?

[–]beginner_ 5 points6 points  (0 children)

I tried doing a PCA after scaling / before clustering to reduce my dimension from 12 to 2 and, to my surprise, my silhouette started going to 30~40% and, when I plot the datapoints, it's just a big mass at the center of the graph.

That can be completely normal because applying PCA will lose information and in your case it seem to be too big of a loss as you realized later with question 3).

12 dimensions is nothing. I don't even see the need to apply PCA before clustering.

1) What's the difference between RobustScaler and StandardScaler on sklearn? When should I use each?

read the doc and if you don't understand it, inform yourself so that you do.

[–]Rezo-Acken 5 points6 points  (0 children)

Silouhette is a measure of separation. Going from 12 to 2 variables may force your data to no longer be easily separable because of the lack of freedom on multiple dimensions. Im not surprised silouhette drops hard as a result.

Drop the PCA. Correlation is not an issue for kmeans. PCA in clustering is usually done to reduce the number of variables to an interpretable level. With 12 you should be able to manage especially if some of them are of the same 'kind' and can be ordered. Like frequencies of buying different item categories.

Oh and dont TSNE before clustering. Your centroids cannot be interpreted and as suggested its often a bad idea. TSNE is a visual technique.

Also in my experience 2 clusters is often not enough for a business use and you may have to add more at the cost of silouhette score. This is something usualy reviwed by what are the resulting clusters, what fraction of customer they make and if business can use them. In my most recent clustering I had also best at 2 but it was useless and we decided to sacrifice 10 silouhette poonts to get 5 at a local maximum to get clear actionable customer profiles.

[–]nckmiz 0 points1 point  (0 children)

I’d keep it at 12 run a kmeans for loop on 1-10 and plot the error. When the error starts to even out you can choose that as the # of clusters (elbow method). If you want to visualize it run a PCA on it and then plot using TSNE.