Rand and Adjusted Rand Index Calculator for Cluster Analysis

版本 1.0.0 (302.7 KB) 作者: qqffssxx
An efficient MATLAB function for computing the Rand Index (RI) and Adjusted Rand Index (ARI),
153.0 次下载
更新时间 2023/6/9

查看许可证

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.

引用格式

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. 检索来源 .

MATLAB 版本兼容性
创建方式 R2018a
兼容任何版本
平台兼容性
Windows macOS Linux
致谢

参考作品: Adjusted Rand Index

Community Treasure Hunt

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

Start Hunting!
版本 已发布 发行说明
1.0.0