I am looking for a proper method to choose the number of clusters for K modes. 

I tried to find the optimal number of clusters by maximizing the average silhouette width though. 

In k-modes,  the average silhouette width increases with the increase of the number of clusters with my case.

So i tried to derive the elbow plot and I got the attached graph.

It is quite hard to which point is the location of a bend in this plot.. 

In this case, how can I choose the best number of groups? 

and Can anyone introduce better method that help choose the optimal number of clusters for K-modes? 

  • $\begingroup$ the graph is attached as above. :) $\endgroup$ – user3242742 Dec 14 '16 at 2:21
  • $\begingroup$ Hi @user3242742, what is the total within diff in your plot? $\endgroup$ – dmeu Sep 8 '17 at 13:19
  • $\begingroup$ im facing the same problem. did you get the solution? $\endgroup$ – anna Oct 17 '17 at 9:25
  • $\begingroup$ How did you determine the total within difference? $\endgroup$ – RNB Oct 14 '19 at 12:36

The elbow is at 4.

Afterwards, the drop follows the usual behavior of random data and 1/x curves.

Since the elbow is not very prominent, the results likely are not very good, and you need to evaluate other preprocessing and clustering methods if they work better.

  • $\begingroup$ Thanks for comment. :) Now I see. I tried to use NbClust packages in R though, it does not provide "K-modes" method... Would you recommend other clustering method for categorical variables? $\endgroup$ – user3242742 Dec 14 '16 at 2:24
  • $\begingroup$ Categorical variables often don't cluster well. I'd consider frequent itemset mining. $\endgroup$ – Has QUIT--Anony-Mousse Dec 14 '16 at 7:15
  • $\begingroup$ Actually, R does provide k-modes in the klaR package. $\endgroup$ – G5W Dec 14 '16 at 16:46
  • 1
    $\begingroup$ @G5W yes I tried this with the klaR package though, it does not provide the additional method to support the decision to choose the proper number of clusters. $\endgroup$ – user3242742 Dec 15 '16 at 4:49

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.