File Exchange

image thumbnail

(simple) Tool for estimating the number of clusters

version 1.2 (36.5 KB) by

12 validity indices, illustrate estimation of the number of clusters

7 Ratings



View License

For validation of clustering results in cluster analysis, it is important to use some objective measures to evaluate the clustering quality. This tool provides programs of such validity indices, including 4 External validity indices and 8 Internal validity indices: Rand index, Adjusted Rand index, Silhouette, Calinski-Harabasz, Davies-Bouldin, Homogeneity, Separation, and etc.

This tool is suitable for the performance comparison of different indices on the estimation of the number of clusters, algorithm design for applications by using or improving part codes, and etc.

Comments and Ratings (10)

Chao Gu

Just one update. the head file for pamc.dll is missing. but I search the website of LIBRA and find the complied mex file for pamc. The windows version works fine. The mac version cause me problem of rebooting.

Chao Gu

Looks like no reply from the author. I couldn't find the head file for pamc.dll. Could you please update this ?


Jacob (view profile)

Does anyone know why the built-in Calinski Harabasz method, does not give the same output as in this toolbox ?? You can try the following code to compare:

eva = evalclusters(X,'kmeans','CalinskiHarabasz','KList',[1:25]);
optimalK = eva.OptimalK;
critVal = eva.CriterionValues;
optimalVal = critVal(optimalK);


my code is producing 3 clusters.
Is there any way to select the cluster automatically?

Phu Lai

I've had this error: "Undefined function or variable 'pamc'"
Please give it a check. Thanks.

It would be great to add the ruspini.mat dataset in the submission. (currently available at


I have the same problem as Praful. Function 'pamc' and 'daisyc' undefined for input arguments of type double.
Does anybody know how to resolve this?


Praful (view profile)

I was trying to run the code, but it say that "Undefined function 'pamc' for input arguments of
type 'double'". Is it that the function 'pamc' is missing?

Thank You


Erik (view profile)

It took me a long time to find this. I needed a piece of software to do the Calinski Harabasz method which I was searching for under the name 'Psuedo F'. This is exactly what I needed.

Günther Eibl

Documentation of functions (input-output) could be improved, but due to the brevity of the code this does not hurt too much.



new release (Version 2.0)


update license

new release (Version 1.8)

MATLAB Release
MATLAB 7.2 (R2006a)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Win prizes and improve your MATLAB skills

Play today