1
$\begingroup$

I have made clusters for my data set (1.5 million samples and 800 features) using k-mean. I am aware of internal indices for evaluating clusters. However, I was thinking about training a supervised classification model (e.g. random forest classifier) in which cluster numbers are dependent variable and all other features are independent variable. Is using the accuracy of this model a good evaluation of the kmean cluster and why?

$\endgroup$
1
$\begingroup$

If you were to have fully formed trees in your random forest, then they should be able to recreate the rules you ended up clustering by, and accuracy would be 100%. Now, if you are cutting off the depth of the trees in the random forest (which is pretty standard, let's say you set max_depth = 8), then you will have an accuracy that may be less than 100%. This means that there are salient features that you are not consistently getting information from because they are not part of the 8 levels that one or more decision trees are using to classify.

My question would then be: why do you want to do this? Once you have the centroids for each cluster using k-means, it is pretty quick to be able to determine which cluster a new record would belong to. I'm not sure I understand why you would want to use a random forest in this fashion.

| improve this answer | |
$\endgroup$
  • $\begingroup$ I am not trying to predict which cluster a new record would belong to. The idea is that if clusters are distinct enough the random forest accuracy should be high and if they are not the accuracy of RF should be low. Can I make such a claim? $\endgroup$ – Dan R Aug 13 '18 at 20:07
  • $\begingroup$ So what are you trying to get out of the random forest classifier then? To validate your clusters? $\endgroup$ – stefanLopez Aug 13 '18 at 20:08
0
$\begingroup$

It is not an indicator of quality if a clustering can be easily predicted by a classifier such as random forest.

In particular with k-means I would argue that the opposite is true.

You have 800 features. With so many festures. You usually have a scaling problem in k-means. In the worst case. The entire result only depends on a single feature. In this degenerate case, a single feature is enough, and a classifier will achieve 100% accuracy. So the conclusion "good classifier, hence good clustering" is clearly wrong.

| improve this answer | |
$\endgroup$
  • $\begingroup$ I have normalized the inputs so there shouldn't be a scaling problem. Actually a single feature is not enough and feature importance from random forest shows that, also the classifier doesn't achieve 100% accuracy at least for finite depth trees. $\endgroup$ – Dan R Aug 14 '18 at 14:15
  • $\begingroup$ Normalizing does not guarantee there is no scaling problem. It just produces other - less obvious - scaling problems. Also this was primarily an abstract counterexample to show that the assumption of a big accuracy cannot indicate you have a good clustering. $\endgroup$ – Has QUIT--Anony-Mousse Aug 14 '18 at 21:03

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.