Doesn't Gap Evaluation work with "Hamming" metric?

1 view (last 30 days)
betty
betty on 23 Oct 2014
Commented: betty on 24 Oct 2014
Hello all,
I tried to use Gap Value to evaluate K-means clustering. It returns error
eva = evalclusters(x,'kmeans','gap','distance','hamming','KList',[1:6])
Warning: Clustering reference data into 1 clusters using function 'getKmeansFunc/nested' generated the following error:
Non-binary data cannot be clustered using Hamming distance.
> In GapEvaluation>GapEvaluation.evalFunXref at 406
In GapEvaluation>GapEvaluation.getRefLogW at 562
In GapEvaluation>GapEvaluation.GapEvaluation at 376
In evalclusters at 172
Warning: Clustering reference data into 2 clusters using function 'getKmeansFunc/nested' generated the following error:
Non-binary data cannot be clustered using Hamming distance.
> In GapEvaluation>GapEvaluation.evalFunXref at 406
In GapEvaluation>GapEvaluation.getRefLogW at 562
In GapEvaluation>GapEvaluation.GapEvaluation at 376
In evalclusters at 172
and so on and so forth.
The data is definitely binary, cause I have applied K-means clustering (Hamming distance) successfully to the same data. It just doesn't work, when I evaluated it with Gap statistic. Can you help me out here? Thanks a lot!!
  1 Comment
betty
betty on 24 Oct 2014
I copy my data (37 x 13) here, please tell me, if you get the same warning after running the gap evaluation. Thanks ~~~
1 0 1 0 1 1 1 0 1 1 1 0 0
0 0 1 0 1 1 1 0 0 1 1 0 0
1 0 0 0 1 0 0 1 0 1 0 1 0
0 1 0 1 0 1 1 1 1 1 0 0 1
1 0 0 0 0 1 1 1 0 1 0 1 0
1 0 1 0 0 1 1 0 0 1 0 1 0
1 1 0 1 0 1 1 1 0 1 0 0 1
0 0 0 1 0 0 0 0 0 1 0 0 1
1 0 0 1 1 1 1 1 1 1 0 1 0
1 0 0 1 0 1 0 0 1 0 1 0 0
0 0 0 0 1 1 0 1 0 1 0 1 0
1 0 0 0 0 1 0 1 0 1 0 0 1
0 0 0 0 0 1 0 0 0 1 0 0 1
0 0 0 1 0 1 0 1 1 0 0 0 1
0 0 0 0 1 1 1 0 1 0 0 0 1
0 1 0 1 0 1 0 0 1 1 0 0 1
0 0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