Does anyone know of a fast K-Modes implementation? Ideally in R.

I am building an ensemble method to group observations with similar labels in different clustering algorithms. The klaR library does have a K-Modes implementation but it's too slow.

asked Jul 02 '10 at 15:30

Phillip%20Mah's gravatar image

Phillip Mah
46139

edited Jul 02 '10 at 21:22

Joseph%20Turian's gravatar image

Joseph Turian ♦♦
579051125146


2 Answers:

Thanks John for your response. I fixed the klaR K-Modes algorithm and its an order of magnitude faster now. I've put it on Github repository K-Modes. I've also sent this to the package maintainer.

Hope this is of use to someone else.

answered Jul 09 '10 at 18:26

Phillip%20Mah's gravatar image

Phillip Mah
46139

edited Jul 09 '10 at 18:37

No problem, Phillip. Thanks for sharing your code!

(Jul 09 '10 at 18:33) John L Taylor

Sifting a bit through the literature (and CRAN, of course), sadly I do not any find readily available code for k-mode clustering in the form you need, but I have found some ways to possibly implement a speed-up, or otherwise get it done:

  1. Recode it better, yourself, following the pseudocode found in Z. Huang (1997) Clustering Large Data Sets with Mixed Numeric and Categorical Values. This is where the k-mode clustering method originates.
  2. Implement the method found in this paper, which outlines k-mode approximation via k-median methods, and motivates it mathematically and empirically.
  3. Implement the swarm-based method, found here.
  4. Ask any above people for their code.
  5. Live with klaR's implementation of k-modes.

If you code something better, be sure to make the world a happier place and share it.

I know that this is falls short of your request, but at least they are some options.

Best of luck.

answered Jul 02 '10 at 20:07

John%20L%20Taylor's gravatar image

John L Taylor
64541518

edited Jul 06 '10 at 18:57

Your answer
toggle preview

powered by OSQA

User submitted content is under Creative Commons: Attribution - Share Alike; Other things copyright (C) 2010, MetaOptimize LLC.