1
$\begingroup$

Does any know the reference/link where i can find the MATLAB implementation of gap statistics for clustering as mentioned in this paper?

$\endgroup$
3
  • 4
    $\begingroup$ Please, don't cross-post on SO and MatlabCentral! $\endgroup$
    – chl
    Commented Jun 5, 2011 at 8:48
  • 2
    $\begingroup$ The gap statistic takes 20 lines of code or less to implement. It may be faster just to write it yourself. $\endgroup$
    – cardinal
    Commented Jun 5, 2011 at 14:45
  • $\begingroup$ @chi ok will not repeat the same. $\endgroup$
    – Learner
    Commented Jun 5, 2011 at 15:14

1 Answer 1

3
$\begingroup$

The Statistics Toolbox implements the gap statistic as a class in the package clustering.evaluation since R2013b:

load fisheriris;
rng('default');  % For reproducibility
eva = evalclusters(meas,'kmeans','gap','KList',[1:6])
figure;
plot(eva);

enter image description here

You can also use this file exchange.

$\endgroup$
3
  • $\begingroup$ +1. I always have a sweet-spot for question archaeologists. On another note, R2013b seems to have really invested in the Stats toolbox functionality. I also saw a first actually usable LME implementation. $\endgroup$
    – usεr11852
    Commented Nov 3, 2013 at 5:25
  • $\begingroup$ The file linked does not produce the same graph for the same data set. It recommends two clusters, rather than 4 on R2011a. $\endgroup$
    – Druckles
    Commented Apr 28, 2014 at 16:45
  • $\begingroup$ Well one of them is wrong or use some variant as the algorithm to compute the gap is supposed to be deterministic :) $\endgroup$ Commented Apr 28, 2014 at 19:33

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