# 兰德指数

兰德指数是一种聚类验证指标，通过统计点对的分类情况来评估同一数据集的两个划分之间的相似度：若两个点在两个划分中都被分到同一簇，或都被分到不同簇，则这一对点是一致的；该指数即为一致点对占所有点对的比例。其取值从最小值到最大值，最大值表示完全一致。由于随机聚类下的取值偏高且不恒定，它主要以经过随机校正的形式使用，即调整兰德指数（ARI）。<sup>[1](https://faculty.washington.edu/kayee/pca/supp.pdf)</sup><sup> • </sup><sup>[2](https://jmlr.csail.mit.edu/papers/volume11/vinh10a/vinh10a.pdf)</sup>

| 关键事实 | 值 |
|---|---|
| 定义 | 在两个划分中以相同方式分类的点对比例，\( R = (a+d)/(a+b+c+d) \)<sup>[1](https://faculty.washington.edu/kayee/pca/supp.pdf)</sup> |
| 原始兰德指数的范围 | 0 到 1；实际中通常位于 [0.5, 1] 内<sup>[2](https://jmlr.csail.mit.edu/papers/volume11/vinh10a/vinh10a.pdf)</sup> |
| 调整兰德指数 | \( \mathrm{ARI} = (RI - E[RI])/(\max(RI) - E[RI]) \)；期望值为 0，最大值为 1，下界为 −0.5<sup>[3](https://scikit-learn.org/stable/modules/generated/sklearn.metrics.adjusted%5Frand%5Fscore.html)</sup><sup> • </sup><sup>[1](https://faculty.washington.edu/kayee/pca/supp.pdf)</sup> |
| 提出者 | William M. Rand，《美国统计协会杂志》，1971 年<sup>[4](https://doi.org/10.1080/01621459.1971.10482356)</sup> |
| 随机校正 | Lawrence Hubert 与 Phipps Arabie，《分类杂志》，1985 年<sup>[5](https://doi.org/10.1007/bf01908075)</sup> |
| 计算 | 由两个聚类的列联表计算，时间复杂度与点数呈线性<sup>[6](https://arxiv.org/pdf/2112.03738.pdf)</sup> |
| 常用软件 | sklearn 的 `adjusted_rand_score`、R flexclust 的 `randIndex`、R aricode<sup>[3](https://scikit-learn.org/stable/modules/generated/sklearn.metrics.adjusted%5Frand%5Fscore.html)</sup><sup> • </sup><sup>[7](https://rdrr.io/cran/flexclust/man/randIndex.html)</sup><sup> • </sup><sup>[8](https://arxiv.org/pdf/2011.08708)</sup> |

## 工作原理

给定同一组 \( N \) 个点的两个聚类，\( \binom{N}{2} \) 个点对中的每一个都落入以下四类之一：\( a \) 为在两个划分中均处于同一簇的点对；\( b \) 和 \( c \) 为在一个划分中同组而在另一个划分中不同组的点对；\( d \) 为在两个划分中均处于不同簇的点对。兰德指数为

\[ R = \frac{a+d}{a+b+c+d}, \]

即两个聚类达成一致的点对决策所占的比例。<sup>[1](https://faculty.washington.edu/kayee/pca/supp.pdf)</sup> 因此它是成对准确率：以 \( k_{11} \) 和 \( k_{00} \) 分别表示在两个划分中均同组和均不同组的点对数，则 \( RI = (k_{11} + k_{00})/\binom{N}{2} \)，相关的米尔金距离为 \( M_K = N(N-1)(1 - RI) \)。<sup>[9](https://jmlr.org/papers/volume17/15-627/15-627.pdf)</sup> 该指数对簇标签的置换不变，因为它从不按名称匹配簇。<sup>[7](https://rdrr.io/cran/flexclust/man/randIndex.html)</sup>

调整版本对兰德指数施加标准的随机校正 \( (S - E(S))/(1 - E(S)) \)。在成对计数形式下，它简化为

\[ \mathrm{ARI} = \frac{2(a \cdot d - b \cdot c)}{(a+b)(b+d) + (a+c)(c+d)}, \]

它同时也是两个调整 Wallace 型指数的调和平均。<sup>[10](https://link.springer.com/content/pdf/10.1007/s00357-022-09413-z.pdf)</sup>

原始指数集中在接近 1 的一个小区间内。<sup>[10](https://link.springer.com/content/pdf/10.1007/s00357-022-09413-z.pdf)</sup> 其基线，即随机划分之间的取值，偏高且不恒定，实际中该指数常位于 [0.5, 1] 内；由于这些原因，它主要以调整形式使用。<sup>[2](https://jmlr.csail.mit.edu/papers/volume11/vinh10a/vinh10a.pdf)</sup> 原因在于 \( d \) 占主导：当簇很多时，大多数点对在两个划分中都被分开，因此两个不相关的聚类仍会在很大比例的点对上一致。<sup>[11](https://jmlr.org/papers/volume18/17-039/17-039.pdf)</sup> Hubert 与 Arabie 的校正通过计算广义超几何模型下兰德指数的期望值来解决这一问题：在该模型中，两个划分在保持每个类和簇中对象数固定的情况下随机抽取，然后重新缩放使该期望映射为 0。<sup>[5](https://doi.org/10.1007/bf01908075)</sup><sup> • </sup><sup>[1](https://faculty.washington.edu/kayee/pca/supp.pdf)</sup> 在该模型下，ARI 的期望值为 0，最大值为 1，可用范围更宽，从而提高了灵敏度。<sup>[1](https://faculty.washington.edu/kayee/pca/supp.pdf)</sup> 对于特别不一致的聚类，其下界为 −0.5；它是对称的，且对于仅在标签置换意义下相同的聚类恰好等于 1.0。<sup>[3](https://scikit-learn.org/stable/modules/generated/sklearn.metrics.adjusted%5Frand%5Fscore.html)</sup>

## 计算方法

该指数由簇归属的列联表计算；对于一般聚类问题，标准算法的时间和内存复杂度为 \( O(N) \)。<sup>[6](https://arxiv.org/pdf/2112.03738.pdf)</sup> scikit-learn 的 `adjusted_rand_score` 通过对列联表边际上的二项式系数求和来计算 \( (RI - E[RI])/ (\max(RI) - E[RI]) \)；其示例中，相同标签的评分为 1.0，而最大不一致的 [0,0,1,1] 与 [0,1,0,1] 为 −0.5。<sup>[3](https://scikit-learn.org/stable/modules/generated/sklearn.metrics.adjusted%5Frand%5Fscore.html)</sup><sup> • </sup><sup>[12](https://github.com/scikit-learn/scikit-learn/blob/a95203b/sklearn/metrics/cluster/supervised.py)</sup> R 包 flexclust 提供 `randIndex`，它还可以返回 Jaccard 指数和 Fowlkes–Mallows 指数。<sup>[7](https://rdrr.io/cran/flexclust/man/randIndex.html)</sup> aricode 包计算修正兰德指数（MRI），它只统计按相似性一致的点对，其时间和空间复杂度与样本数呈线性，且与簇数无关，因为它从不构建列联表。<sup>[8](https://arxiv.org/pdf/2011.08708)</sup> 对于具有连续簇的变点问题，该指数可以仅由两个变点集合在 \( O(r+s) \) 时间和 \( O(1) \) 内存内计算，其中 \( r \) 和 \( s \) 为变点数量。<sup>[6](https://arxiv.org/pdf/2112.03738.pdf)</sup>

## 起源

当时在麻省理工学院的 William M. Rand 在《美国统计协会杂志》1971 年的论文《聚类方法评价的客观标准》中提出了该指数。<sup>[4](https://doi.org/10.1080/01621459.1971.10482356)</sup><sup> • </sup><sup>[4](https://doi.org/10.1080/01621459.1971.10482356)</sup> 该统计量被称为 \( C \)，取值从 0.0 到 1.0（含端点），1.0 表示完全一致。<sup>[13](https://www.sciencedirect.com/science/article/abs/pii/S0167715204001646)</sup> Hubert 与 Arabie 在《比较划分》（《分类杂志》，1985 年）中提供了随机校正。<sup>[5](https://doi.org/10.1007/bf01908075)</sup> Steinley 于 2004 年在《心理学方法》上考察了 Hubert-Arabie 调整兰德指数的性质，<sup>[14](https://doi.org/10.1037/1082-989x.9.3.386)</sup> Steinley、Brusco 与 Hubert 于 2016 年在同一期刊上推导了其方差。<sup>[15](https://doi.org/10.1037/met0000049)</sup>

## 变体

若干族系修改了成对计数方案。概率兰德指数按点对的一致或不一致偶然发生的概率对其加权；Carpineto 与 Romano 将其引入共识聚类，把共识表述为 PRI 的优化，发表于 2012 年的 IEEE TPAMI。<sup>[16](https://doi.org/10.1109/tpami.2012.80)</sup> 归一化概率兰德（NPR）指数将其扩展到针对多个人工标注真值评估的图像分割，从参考数据估计点对概率。<sup>[17](https://publications.ri.cmu.edu/storage/publications/pub_files/pub4/unnikrishnan_ranjith_2005_2/unnikrishnan_ranjith_2005_2.pdf)</sup> 对于单细胞 RNA 测序，加权兰德指数（wRI）考虑了细胞类型层级。<sup>[18](https://link.springer.com/article/10.1186/s13059-020-02027-x)</sup> 多项式 MARI 用多项式零模型替代超几何零模型。<sup>[8](https://arxiv.org/pdf/2011.08708)</sup> Yan、Feng 与 Luo 于 2025 年提出了空间感知的 spRI 和 spARI，它们根据对象之间的空间距离给不一致点对赋权，在适当的随机零模型下期望为零。<sup>[19](https://doi.org/10.1093/biomtc/ujaf127)</sup>

## 应用

Milligan 与 Cooper 在 1986 年评估了许多一致性指数，并推荐 ARI 作为首选指数，后来的作者将其提议为聚类验证的标准工具。<sup>[1](https://faculty.washington.edu/kayee/pca/supp.pdf)</sup><sup> • </sup><sup>[10](https://link.springer.com/content/pdf/10.1007/s00357-022-09413-z.pdf)</sup> 在图像分割中，NPR 指数针对多个人工标注真值评估分割结果。<sup>[17](https://publications.ri.cmu.edu/storage/publications/pub_files/pub4/unnikrishnan_ranjith_2005_2/unnikrishnan_ranjith_2005_2.pdf)</sup> 在单细胞 RNA 测序中，wRI 对密切相关的亚型（如 CD4 和 CD8 T 细胞）分组的权重低于对明显不同的类型（如 T 细胞和 B 细胞）分组的权重。<sup>[18](https://link.springer.com/article/10.1186/s13059-020-02027-x)</sup> spRI 和 spARI 被提议用于空间转录组学，GitHub 上提供了 R 包。<sup>[19](https://doi.org/10.1093/biomtc/ujaf127)</sup> 指数选择在实践中很重要：相似性指数之间的分歧会影响偏好哪种算法，并可能降低实际性能。<sup>[20](https://proceedings.mlr.press/v139/gosgens21a.html)</sup>

## 局限与替代方案

Warrens 与 van der Hoef 建议不要使用兰德指数及类兰德指数，因为它们的值主要由在两个划分中均未同组的对象对决定，而这并不能清楚地表明一致性。<sup>[10](https://link.springer.com/content/pdf/10.1007/s00357-022-09413-z.pdf)</sup> 随着簇数增加，该指数被分到不同簇的点对所主导，降低了对共现点对的灵敏度。<sup>[11](https://jmlr.org/papers/volume18/17-039/17-039.pdf)</sup> 在 1000 个样本和 10 个真值类的实验中，一旦簇数超过类数，原始指数即饱和，而 ARI 和 AMI 保持在 0 附近；不应使用未调整的指标来比较产生不同簇数的算法。<sup>[21](https://scikit-learn.org/stable/auto%5Fexamples/cluster/plot_adjusted_for_chance_measures.html)</sup> 包括 ARI 在内的成对计数指数也受簇大小不平衡的影响，主要反映大簇上的一致，对较小簇提供的信息很少。<sup>[10](https://link.springer.com/content/pdf/10.1007/s00357-022-09413-z.pdf)</sup> 调整指数是非局部的：单个簇内部的变化会因其余数据的聚类方式而计数不同，且没有任何划分比较准则能满足 Meilă 的全部三条理想公理性质。<sup>[22](https://icml.cc/Conferences/2005/proceedings/papers/073_ComparingClustering_Meila.pdf)</sup> 与替代方案相比，兰德指数对假阳性和假阴性等权，而 F 度量可能更严厉地惩罚假阴性。<sup>[23](https://nlp.stanford.edu/IR-book/html/htmledition/evaluation-of-clustering-1.html)</sup> 在调整度量中，ARI 等于 \( \mathrm{AMI}_2 \)，即广义调整族的一个特例；已发表的指南是：当参考聚类具有大而等大的簇时应使用 ARI，当参考聚类不平衡且簇较小时应使用 AMI。<sup>[9](https://jmlr.org/papers/volume17/15-627/15-627.pdf)</sup>

期望的选择存在争议。Morey 与 Agresti 于 1984 年在多项式模型下推导了一个期望，但后来的分析表明这不能很好地近似精确的超几何期望，差距有时随样本量增大，且多项式版本在检验中过度偏向零假设。<sup>[24](https://doi.org/10.1177/0013164484441003)</sup><sup> • </sup><sup>[25](https://bpspsychub.onlinelibrary.wiley.com/doi/10.1111/bmsp.12116)</sup> 相反，Sundqvist、Chiquet 与 Rigaill 认为超几何假设不能令人满意，因为它强制固定簇大小，在聚类相关时不适用，且忽略了抽样随机性；他们基于多项式的 MARI 在小样本下与 ARI 差异显著，但在大 \( n \) 下差异基本消失。<sup>[8](https://arxiv.org/pdf/2011.08708)</sup>

## References

1. [Supplement illustrating the Adjusted Rand index (Yeung et al. context, Univ. of Washington)](https://faculty.washington.edu/kayee/pca/supp.pdf)
2. [Information Theoretic Measures for Clusterings Comparison: Variants, Properties, Normalization and Correction for Chance (Vinh, Epps, Bailey, JMLR 2010)](https://jmlr.csail.mit.edu/papers/volume11/vinh10a/vinh10a.pdf)
3. [adjusted_rand_score, scikit-learn documentation](https://scikit-learn.org/stable/modules/generated/sklearn.metrics.adjusted%5Frand%5Fscore.html)
4. [William M. Rand (1971). Objective Criteria for the Evaluation of Clustering Methods. Journal of the American Statistical Association.](https://doi.org/10.1080/01621459.1971.10482356)
5. [Lawrence Hubert, Phipps Arabie (1985). Comparing partitions. Journal of Classification.](https://doi.org/10.1007/bf01908075)
6. [A more efficient algorithm to compute the Rand Index for change-point problems (arXiv 2021)](https://arxiv.org/pdf/2112.03738.pdf)
7. [randIndex: Compare Partitions in flexclust (R package documentation)](https://rdrr.io/cran/flexclust/man/randIndex.html)
8. [Adjusting the adjusted Rand Index, A multinomial story (Sundqvist, Chiquet & Rigaill; published in Computational Statistics 2023)](https://arxiv.org/pdf/2011.08708)
9. [Adjusting for Chance Clustering Comparison Measures (Romano, Vinh, Bailey, Verspoor, JMLR 2016)](https://jmlr.org/papers/volume17/15-627/15-627.pdf)
10. [Understanding the Adjusted Rand Index and Other Partition Comparison Indices Based on Counting Object Pairs (Warrens & Van der Hoef, 2022, Journal of Classification)](https://link.springer.com/content/pdf/10.1007/s00357-022-09413-z.pdf)
11. [The Impact of Random Models on Clustering Similarity (Gates & Ahn, JMLR 2017)](https://jmlr.org/papers/volume18/17-039/17-039.pdf)
12. [sklearn/metrics/cluster/supervised.py source](https://github.com/scikit-learn/scikit-learn/blob/a95203b/sklearn/metrics/cluster/supervised.py)
13. [Moments of Rand's C statistic in cluster analysis (Statistics & Probability Letters)](https://www.sciencedirect.com/science/article/abs/pii/S0167715204001646)
14. [Douglas Steinley (2004). Properties of the Hubert-Arable Adjusted Rand Index.. Psychological Methods.](https://doi.org/10.1037/1082-989x.9.3.386)
15. [Douglas Steinley, Michael J. Brusco, Lawrence Hubert (2016). The variance of the adjusted Rand index.. Psychological Methods.](https://doi.org/10.1037/met0000049)
16. [C. Carpineto, G. Romano (2012). Consensus Clustering Based on a New Probabilistic Rand Index with Application to Subtopic Retrieval. IEEE Transactions on Pattern Analysis and Machine Intelligence.](https://doi.org/10.1109/tpami.2012.80)
17. [A Measure for Objective Evaluation of Image Segmentation Algorithms (Unnikrishnan, Pantofaru, Hebert, CMU)](https://publications.ri.cmu.edu/storage/publications/pub_files/pub4/unnikrishnan_ranjith_2005_2/unnikrishnan_ranjith_2005_2.pdf)
18. [Accounting for cell type hierarchy in evaluating single cell RNA-seq clustering (Genome Biology)](https://link.springer.com/article/10.1186/s13059-020-02027-x)
19. [Yinqiao Yan, Xiangnan Feng, Xiangyu Luo (2025). Spatially aware adjusted Rand index for evaluating spatial transcriptomics clustering. Biometrics.](https://doi.org/10.1093/biomtc/ujaf127)
20. [Systematic Analysis of Cluster Similarity Indices: How to Validate Validation Measures (ICML 2021, PMLR)](https://proceedings.mlr.press/v139/gosgens21a.html)
21. [Adjustment for chance in clustering performance evaluation, scikit-learn example](https://scikit-learn.org/stable/auto%5Fexamples/cluster/plot_adjusted_for_chance_measures.html)
22. [Comparing Clusterings – An Axiomatic View (Meilă, ICML 2005)](https://icml.cc/Conferences/2005/proceedings/papers/073_ComparingClustering_Meila.pdf)
23. [Evaluation of clustering (Stanford IR Book, Manning, Raghavan & Schütze)](https://nlp.stanford.edu/IR-book/html/htmledition/evaluation-of-clustering-1.html)
24. [Leslie C. Morey, Alan Agresti (1984). The Measurement of Classification Agreement: An Adjustment to the Rand Statistic for Chance Agreement. Educational and Psychological Measurement.](https://doi.org/10.1177/0013164484441003)
25. [A note on the expected value of the Rand index (British Journal of Mathematical and Statistical Psychology)](https://bpspsychub.onlinelibrary.wiley.com/doi/10.1111/bmsp.12116)

---
*Initially written Sep 29, 2026 · Edited: Oct 15, 2026; Oct 21, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 统计学与概率论 › Multivariate association and dimension reduction › Titles Mo to W

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/rand-index

English original: https://www.edgepedia.org/rand-index
