Clustering results measurement

Measure percentage of Accuracy and the Rand index of clustering results
19K Downloads
Updated 11 Jul 2016

View License

Measure percentage of Accuracy and the Rand index of clustering results
The number of class must equal to the number cluster
Output
Acc = Accuracy of clustering results
rand_index = Rand's Index, measure an agreement of the clustering results
match = 2xk matrix which are the best match of the Target and clustering results
Input
T = 1xn target index
idx =1xn matrix of the clustering results

EX:
X=[randn(200,2);randn(200,2)+6,;[randn(200,1)+12,randn(200,1)]]; T=[ones(200,1);ones(200,1).*2;ones(200,1).*3];
idx=kmeans(X,3,'emptyaction','singleton','Replicates',5);
[Acc,rand_index,match]=AccMeasure(T,idx)

Cite As

Praisan Padungweang (2024). Clustering results measurement (https://www.mathworks.com/matlabcentral/fileexchange/32197-clustering-results-measurement), MATLAB Central File Exchange. Retrieved .

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

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.2.0.0

1. Bug fix.
2. Corrected the example code.

1.1.0.0

correct the example code

1.0.0.0