Rand and Adjusted Rand Index Calculator for Cluster Analysis

Version 1.0.0 (303 KB) von qqffssxx
An efficient MATLAB function for computing the Rand Index (RI) and Adjusted Rand Index (ARI),
153 Downloads
Aktualisiert 9. Jun 2023

Lizenz anzeigen

This function, named randindex, allows users to calculate two crucial statistical measures, the Rand Index (RI) and the Adjusted Rand Index (ARI), which are commonly used for comparing the similarity between two data clusterings. The function is compatible with any numerical labels used for clustering and returns both the RI and ARI values for easy performance comparison and clustering evaluation.
In clustering tasks, measuring the quality and the reliability of the results is essential. The Rand Index (RI) measures the percentage of decisions that are consistent between two clusterings, while the Adjusted Rand Index (ARI) corrects the RI by the chance grouping of elements, providing a more robust statistic for comparing different clustering algorithms or methods.
Usage is straightforward. Simply provide two same-length vectors of labels, representing two different clustering results, and the function will return the corresponding RI and ARI values.
The function was thoroughly tested against Python's sklearn library metrics, ensuring its accuracy and reliability.
Example usage:
labels1 = [1 1 2 3 2 1 1 3 2 2];
labels2 = [2 2 3 1 3 2 2 1 3 3];
[RI, ARI] = randindex(labels1, labels2);
disp(['RI: ', num2str(RI)]);
disp(['ARI: ', num2str(ARI)]);
We hope you find this function useful in your data analysis tasks.

Zitieren als

qqffssxx (2024). Rand and Adjusted Rand Index Calculator for Cluster Analysis (https://www.mathworks.com/matlabcentral/fileexchange/130779-rand-and-adjusted-rand-index-calculator-for-cluster-analysis), MATLAB Central File Exchange. Abgerufen .

Kompatibilität der MATLAB-Version
Erstellt mit R2018a
Kompatibel mit allen Versionen
Plattform-Kompatibilität
Windows macOS Linux
Quellenangaben

Inspiriert von: Adjusted Rand Index

Community Treasure Hunt

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

Start Hunting!
Version Veröffentlicht Versionshinweise
1.0.0