I have implemented some internal clustering validity indexes in Java:
- Simplified Silhouette.
- Calinski-Harabasz (VRC).
- Davies -Bouldin.
- Dunn's Index.
How could I verify if my implementation is correct?
I have tested the indexes on Iris, Wine, Ionosphere, Heart, Sonar, Zoo and Glass benchmarks.
I used K-Means algorithm with different number of clusters from 2 to 8.
The problem is: I obtain the best scores in partitions with 2 clusters in most of the cases. In Zoo and Glass datasets, in which the real number of clusters is 7, only one of the indexes scores the best in the case where k=7.
If it's important to mention:
- K-Means (Trickl-Cluster's Implementation) results are identical to Weka's output (tested on iris dataset).
- The calculation of the centroids (means of the clusters) is almost identical to Weka's output.
- The used API to perform calculations on Matrices is Colt (computing the norm, operations on matrices, distances between clusters centroids...).
What's wrong?