clustering accuracy

Version 1.0.0 (1.41 KB) by Dong Dong
Find the clustering accuracy of a prediction, given the true labels
132 Downloads
Updated 28 Jun 2020

View License

function acc=cluster_acc(label,pred)
%Find the clustering accuracy of prediction, given the true labels. The Matlab bulti-in function matchpairs is used to avoid the permutation function.
%Output
% acc = Accuracy of clustering results

%Input
% ytrue = a vector of true labels
% ypred = a vector of the predicted labels

Cite As

Dong Dong (2026). clustering accuracy (https://ch.mathworks.com/matlabcentral/fileexchange/77452-clustering-accuracy), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2020a
Compatible with R2019a and later releases
Platform Compatibility
Windows macOS Linux
Version Published Release Notes
1.0.0