File Exchange

image thumbnail

CVAP: Cluster Validity Analysis Platform (cluster analysis and validation tool)

version (80.5 KB) by Kaijun Wang
supplying over 17 validity indices and 5 clustering algorithms based on GUI


Updated 25 Jul 2009

View License

Cluster validation is an important and necessary step in cluster analysis. This visual cluster validation tool CVAP based on GUI provides important tools and convenient analysis environment for validity evaluation of clustering solutions, estimation of the number of clusters and performance comparison between candidate clustering algorithms.

CVAP includes 4 External validity indices, 14 Internal validity indices and 5 clustering algorithms (K-means, PAM, hierarchical clustering and etc.). It supports other clustering algorithms via loading a solution file with class labels, or by adding new codes. And similarity metrics of Euclidean distance and Pearson correlation coefficient are supported.

Some useful information and references are in help files "Readme.txt", please read them first.

Cite As

Kaijun Wang (2020). CVAP: Cluster Validity Analysis Platform (cluster analysis and validation tool) (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (46)

Ali Abdo

I have been trying to use this toolbox for determining the number of clusters using SOM but when i run the code i get a blank GUI.
What should I do with it ?
How can I solve this problem?
Thanks in advance


This platform does unfortunately not work with R2018b. When trying to load the data in GUI, the following error message appears:

Not enough input arguments.

Error in pwd (line 24)
L = length(x);

Error in matlab.ui.internal.dialog.FileSystemChooser/initialize (line 54)
obj.InitialPathName = pwd;

Error in matlab.ui.internal.dialog.FileChooser/initialize (line 356)

Error in matlab.ui.internal.dialog.FileOpenChooser/initialize (line 61)

Error in matlab.ui.internal.dialog.FileChooser (line 32)

Error in matlab.ui.internal.dialog.FileOpenChooser (line 10)
function obj = FileOpenChooser(varargin)

Error in uigetputfile_helper (line 41)
ufd = matlab.ui.internal.dialog.FileOpenChooser();

Error in uigetfile (line 130)
[filename, pathname, filterindex] = uigetputfile_helper(0, varargin{:});

Error in mainCVAP>Loadata_Callback (line 206)
[file,filePath] = uigetfile('*.txt');

Error in gui_mainfcn (line 95)

Error in mainCVAP (line 18)
gui_mainfcn(gui_State, varargin{:});

Error while evaluating Menu Callback.


Please The calculation of KL and CH are not correct?

CVAP does not run correctly in versions of Matlab superior to 2013.

Phu Lai

Dunn Index needs to be reviewed.

Phu Lai

Agree with NR P's comment below. DB Index also needs to be reviewed.

Phu Lai

Be careful when using internal validation. The computation of CH and KL Index seem to be not correct.

Phu Lai

I've found some problem with 2016b, GUI doesn't semm to have all buttuns and funcionalities

Auri A

CVAP runs perfectly in 2012 matlab version.

Auri A

I am facing problem while including fuzzy c-means algorithm in CVAP code.Can anyone help me with this?

follow up with my previous question, I found the answer!

Hi All,
I am facing problem with using PAM, it seems that the function pamc in line 158 from the pam function is missing!
have anyone faced the same problem before?
pls, advice?

Anis Najar

Hello, the tool does not seem to work properly in Matlab2015a!!

Great tool, very useful.
I´ll like to know how can be added new distances measures to the GUI, since I´ll like try specific measures for the data i´m working with, like Mahalanobis distance.


please can you indicate me codes about the (f-meseare index) and (silhouette index)
i'm begginer in matlab and i must prepare a home work this week using these indexes

please help me if it is possible

On the main form, DateSet is not loading. ANy suggestions?

I am using matlab r2014b. It seems not working with this version. Have anyone tried in this version?



Thank you for this work

i am working for my project on dynamic clustering of iris data using pso
i hav used your code for db index in my code
but i have a trouble with the results
most of the papers give 0.45 for the mean value of db index
but i find 0.219 as mean value for db index
can you please indicate me if it is possible

Hola estoy haciendo un trabajo sobre clustering, y necesito validar el grupo de datos.


Please review valid_internal_deviation.m: I believe it has errors in the correction factors for Calinski-Harabasz and Krzanowski-Lai indices, and Davies-Bouldin index estimante apper to derive for incomplete pairwise estimates.



When applying kmeans algorithm with euclidean distance function, kmeans algorithm in valid_clusteringAlgs.m (at line 29 of CVAP 3.7 version) uses the distance function R = 'sqEuclidean';. However, when evaluating with silhouette measure in valid_internal.m(at line of 28), the code uses R = 'euclidean';. I think the same distance function should be used.

Nejc Ilc

Many thanks to the author for his valuable and useful contribution. However, I think there is a bug in the implementation of the Dunn's index.

I have compared results from CVAP with the Julian Ramos' implementation ( and also with R package clValid. Output values from clValid and Ramos' code are identical, whereas the CVAP results are not in an agreement with them. I think there are errors in computing the diameter of clusters and the shortest distance between clusters (function 'valid_sumsqures'). Please, consider revising this part of code.


As this was made for an older version of matlab, the pamc.dll is no longer valid.
To solve errors with the pamc function, download the latest mex files from here:

32-bit win => pamc.mexw32
64-bit win => pamc.mexw64

Alternatively, 32-bit windows users can also try renaming the pamc.dll to pamc.mexw32 although this has not been tested.


The link below should be :


I find there is a problem in the CVAP, when I used the pam.m, it must call the pamc.m, but the pamc.m is not exist in this CVAP


What is the best place to add a validity indices? I saw the place for a new clustering algorithm, but don't see anything similar for indices.


I think this tool is good.


I am having trouble uploading a data file. Mine is a .txt, but I still get loads of errors. Why?

??? Attempted to access data(:,1); index out of bounds because size(data)=[0,0].
Error in ==> valid_data_load at 18
handles.truelabels = data(:,1);

zhen gao

How to use it. When I type "mainCVAP"
It shows "Undefined function or variable 'mainCVAP'". Why?

agnes cawas

I'm looking for method to validate the result cluster with k-means and I exactly refuse to know about validate k-means you have any idea?
then i read this article and I want to know how to calculate the error rate of the result for k-means clustering...
is this use SSE(sum square error)?
please replies me...

Cara Tobin

Hello, this model is very user-friendly with the demo files. However, if I have 8000 parameter sets (each with 3 parameters), how does one prepare the input file? I had a matrix of 8000 rows with 3 columns (no classes) and this didnt seem to work. Any suggestions? THANK YOU!! Cara

Very useful, I have looked for such a tool for a long time. Do you have developed a validity indice for subspace clustering ?

Thank you very much, great job !

Dennis Lorch

Very good tool. Does anyone know how to include alternative distances in this GUI?

Guillermo Quintas

I found this job really good and very usefull. I have include the option of using matrices from the workspace. I thonk that it really improve the usefulness of the GUI.

Leon Kegel

Very useful toolbox.
You have done realy a great job on CVAP!

yurniar rica

i need matlab code hierarchical clustering for image...

ling zhao

I think your toolbox is just fine. It will be used for me.


new release (version 3.7)

new release (version 3.6)

new release CVAP3.6

new release CVAP3.5

new release (version 3.42)

new release (version 3.4)

MATLAB Release Compatibility
Created with R2006a
Compatible with any release
Platform Compatibility
Windows macOS Linux