2
$\begingroup$

I was experimenting with clustering using kmeans on a large data set having mostly numerical variables (How Americans spend their time) in my class. A few of them (like education, marital status etc) that were categorical were transformed to dummy variables. As numerical variables (such as TV time, time spent with children, no of children etc) had varying value-range. It was necessary to scale and transform them.

A question has arisen whether besides scaling should we also try to make skewed data symmetric by using, BoxCox, transformations. In, R, caret package has a nice and easy pre-processing facility and in one command can carry out all transformations and scaling.

My question is: As the BoxCox transformation is a power-transformation, will it not change the shape of data distribution and we may get a different set of clusters than were originally existing in the dataset? While linear scaling of data may be OK, I am little skeptical about BoxCox transformations.

I will be grateful for an answer.

$\endgroup$
2
$\begingroup$

k-means is very sensitive to data distribution.

In particular the use of k-means on binary (e.g. dummy) variables is questionable, because the mean does not make too much sense anymore. You cannot easily map back cluster centers to attribute values!

As for using box-cox with k-means that is actually a good thing. k-means does not handle skewed distributions well. So e.g. an attribute "income" (which is notoriously skewed) such a transformation may improve results a lot.

$\endgroup$
  • $\begingroup$ May I ask a related question or shall I put it as a new question: PCA is known to carry out ellipsoidal transformation before rendering principal components. Can I PCA before kmeans? $\endgroup$ – user3282777 Aug 17 '16 at 11:09
  • 1
    $\begingroup$ Yes, but you should be aware of the effects of PCA - the change to the result may be desired, or not (very often: not desirable). The input data should be continuous - the results of doing PCA on binary variables and then running k-means is questionable, even if it should work. $\endgroup$ – Anony-Mousse Aug 17 '16 at 12:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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