1

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

Learner
  • 4,457

1 Answers1

3

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.

Franck Dernoncourt
  • 46,817
  • 33
  • 176
  • 288
  • +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. – usεr11852 Nov 03 '13 at 05:25
  • The file linked does not produce the same graph for the same data set. It recommends two clusters, rather than 4 on R2011a. – Druckles Apr 28 '14 at 16:45
  • Well one of them is wrong or use some variant as the algorithm to compute the gap is supposed to be deterministic :) – Franck Dernoncourt Apr 28 '14 at 19:33