# 调整兰德指数

调整兰德指数（Adjusted Rand index，ARI）是一种经机会校正的相似性度量，它通过统计同一组项目的两种划分中项目对的归组情况来比较这两种划分，然后对计数进行校正，以扣除当两个标签分配是随机的情况下所期望的一致性。当两个聚类在标签置换意义下完全相同时，它等于1.0；对于随机标签分配，无论聚类数和样本数多少，它都接近于0.0；当两个聚类的一致性低于随机预期时，它可以是负值。<sup>[1](https://sklearn.org/stable/modules/generated/sklearn.metrics.adjusted_rand_score.html)</sup> 在单细胞RNA测序分析中，ARI和归一化互信息是衡量聚类结果与参考标签之间一致性最广泛使用的度量。<sup>[2](https://link.springer.com/article/10.1186/s13059-020-02027-x)</sup>

| 关键事实 | 详情 |
|---|---|
| 度量内容 | 同一n个项目的两种划分之间的一致性，按项目对计数并做机会校正<sup>[1](https://sklearn.org/stable/modules/generated/sklearn.metrics.adjusted_rand_score.html)</sup> |
| 解读 | 1.0 = 在标签置换意义下相同；接近0.0 = 随机标签；负值 = 一致性低于随机预期<sup>[1](https://sklearn.org/stable/modules/generated/sklearn.metrics.adjusted_rand_score.html)</sup> |
| 一般形式 | \( S^{*} = (S - E(S))/(1 - E(S)) \)，其中 \( E(S) \) 在固定行和与列和下计算<sup>[3](https://arxiv.org/pdf/1901.01777v1.pdf)</sup> |
| 随机性模型 | 广义超几何分布：在类别大小和聚类大小固定的条件下随机抽取划分<sup>[4](https://faculty.washington.edu/kayee/pca/supp.pdf)</sup> |
| 与AMI的关系 | ARI等于AMI\(_{2}\)，即Tsallis熵参数为 \( q = 2 \) 的调整信息论度量<sup>[5](https://jmlr.org/papers/volume17/15-627/15-627.pdf)</sup> |
| 实用建议 | 当参考聚类具有大而等大的簇时优先使用ARI；当参考聚类不平衡且簇较小时优先使用AMI<sup>[5](https://jmlr.org/papers/volume17/15-627/15-627.pdf)</sup> |
| 软件 | scikit-learn的 `adjusted_rand_score`；R包aricode基于桶排序以高效的 \( O(n) \) 算法计算该指数<sup>[6](https://cran.r-project.org/web/packages/aricode/refman/aricode.html)</sup> |

## 工作原理

兰德指数和ARI都基于对对象对的计数：对于每一对项目，该对要么在两个划分中都被归入同一组，要么在两个划分中都被分开，要么在一个划分中被归入同一组而在另一个划分中被分开。ARI使用一般机会校正形式 \( S^{*} = (S - E(S))/(1 - E(S)) \) 对兰德指数进行机会一致性校正，其中 \( E(S) \) 是在匹配表的行和与列和固定的条件下该指数的期望值，而1是 \( S \) 的最大值。<sup>[3](https://arxiv.org/pdf/1901.01777v1.pdf)</sup> scikit-learn将同一思想写作 \( \mathrm{ARI} = (\mathrm{RI} - \mathrm{Expected\_RI})/(\max(\mathrm{RI}) - \mathrm{Expected\_RI}) \)。<sup>[1](https://sklearn.org/stable/modules/generated/sklearn.metrics.adjusted_rand_score.html)</sup>

期望值来自广义超几何模型：两个划分被视为在各类别和簇中对象数量固定的条件下随机抽取。<sup>[4](https://faculty.washington.edu/kayee/pca/supp.pdf)</sup> 在这种固定边际模型下，若 \( T \) 为在两个划分中都被归入同一组的对的数量，\( A \) 和 \( B \) 分别为两个划分内的对总数，且 \( M = \binom{n}{2} \)，则 \( E[T] = AB/M \)，由此得到 \( \mathrm{ARI} = (T - AB/M)/(\tfrac{1}{2}(A + B) - AB/M) \)；用概率语言表述，\( \mathrm{ARI} = (\Pr(\text{一致}) - \Pr_{0}(\text{一致}))/(1 - \Pr_{0}(\text{一致})) \)，其中 \( \Pr_{0} \) 是由观测到的簇大小设定的独立性基线。<sup>[7](https://arxiv.org/html/2511.03000)</sup>

斯坦利（2004）给出了一个简洁的列联表版本。设 \( a, b, c, d \) 为2×2对计数表的四个单元格，\( N \) 为对的总数，则 \( \mathrm{ARI} = [N(a+d) - \{(a+b)(a+c) + (c+d)(b+d)\}]/[N^{2} - \{(a+b)(a+c) + (c+d)(b+d)\}] \)。<sup>[8](https://link.springer.com/article/10.1007/s11634-022-00491-w)</sup>

## 计算方法

实践者按如下步骤计算n个项目两种划分之间的ARI。首先，构建列联表 \( n_{ij} \)，将第一个划分的簇与第二个划分的簇交叉，行和为 \( a_{i} \)，列和为 \( b_{j} \)。其次，计算对计数 \( \sum_{ij} \binom{n_{ij}}{2} \)、\( \sum_{i} \binom{a_{i}}{2} \) 和 \( \sum_{j} \binom{b_{j}}{2} \)。第三，将它们代入标准公式

\[ \mathrm{ARI} = \frac{\sum_{ij} \binom{n_{ij}}{2} - \left(\sum_{i} \binom{a_{i}}{2}\right)\left(\sum_{j} \binom{b_{j}}{2}\right)/\binom{n}{2}}{\tfrac{1}{2}\left(\sum_{i} \binom{a_{i}}{2} + \sum_{j} \binom{b_{j}}{2}\right) - \left(\sum_{i} \binom{a_{i}}{2}\right)\left(\sum_{j} \binom{b_{j}}{2}\right)/\binom{n}{2}} \]<sup>[9](https://research.gold.ac.uk/id/eprint/30945/1/Paper.pdf)</sup>

当两个划分都是全单例，或都由单个簇组成时，公式给出0/0；scikit-learn按惯例将结果定义为1.0，并如此标注，以免被误认为真正的一致性。<sup>[10](https://induwara.lk/tools/adjusted-rand-index-calculator)</sup> 该分数是对称的：`adjusted_rand_score(a, b)` 等于 `adjusted_rand_score(b, a)`。<sup>[1](https://sklearn.org/stable/modules/generated/sklearn.metrics.adjusted_rand_score.html)</sup>

在软件方面，scikit-learn实现了标准指数，R包aricode实现了ARI、RI、NMI、AMI及相关度量，采用 \( \Theta(n) \) 桶排序算法，其代价不依赖于簇的数量；而mclust的 `adjustedRandIndex` 等传统实现运行时间为 \( \Omega(n + uv) \)。<sup>[6](https://cran.r-project.org/web/packages/aricode/refman/aricode.html)</sup>

## 起源

威廉·M. 兰德在《聚类方法评价的客观标准》（"Objective Criteria for the Evaluation of Clustering Methods"，《美国统计协会杂志》，1971年）中引入了兰德指数；其标准基于一种相似性度量，考虑每一对数据点在两个聚类中各自如何被分配。<sup>[11](https://doi.org/10.1080/01621459.1971.10482356)</sup> 莫雷和阿格雷斯蒂于1984年指出该指数未考虑可能的机会一致性，并提出了一种渐近多项式调整。<sup>[12](https://doi.org/10.1177/0013164484441003)</sup> 随后劳伦斯·休伯特和菲普斯·阿拉比在《比较划分》（"Comparing partitions"，《分类杂志》，1985年）中引入了经机会校正的版本，即调整兰德指数。<sup>[13](https://doi.org/10.1007/bf01908075)</sup> 米利根和库珀（1986）评估了许多一致性指数，并推荐ARI作为外部聚类评价的首选指数，<sup>[8](https://link.springer.com/article/10.1007/s11634-022-00491-w)</sup> 道格拉斯·斯坦利于2004年在《心理学方法》上对其性质的分析进一步巩固了它作为标准聚类验证工具的地位。<sup>[14](https://doi.org/10.1037/1082-989x.9.3.386)</sup>

期望模型的历史存在争议：后来的记述报告称，莫雷和阿格雷斯蒂在计算兰德指数的期望值时犯了错误，假设变量平方的期望值等于该变量期望值的平方。<sup>[15](https://ar5iv.labs.arxiv.org/html/2011.08708)</sup>

## 变体

原始兰德指数 \( R = (a+d)/(a+b+c+d) \) 不需要期望模型，但其值集中在1附近的一个小区间内，因为其值主要由在两个划分中都未被归入同一组的对象对决定。<sup>[3](https://arxiv.org/pdf/1901.01777v1.pdf)</sup> ARI是若干经机会校正的度量之一，与调整互信息并列；值得注意的是，ARI等于AMI\(_{2}\)，即调整广义信息论度量的一个特例。<sup>[5](https://jmlr.org/papers/volume17/15-627/15-627.pdf)</sup>

桑德奎斯特、希凯和里盖尔在《调整调整兰德指数——一个多项式故事》（"Adjusting the adjusted Rand Index -- A multinomial story"）中提出了不强制固定簇大小的多项式调整MARI；<sup>[15](https://ar5iv.labs.arxiv.org/html/2011.08708)</sup> 该论文于2023年发表在《计算统计学》第38卷第1期第327–347页。<sup>[16](https://ideas.repec.org/a/spr/compst/v38y2023i1d10.1007_s00180-022-01230-7.html)</sup> 对于层次参考，加权兰德指数对将密切相关的亚型（如T细胞内的CD4和CD8 T细胞）归为一组给予部分分数。<sup>[2](https://link.springer.com/article/10.1186/s13059-020-02027-x)</sup> 模糊扩展包括调整一致性指数（Adjusted Concordance Index，ARI向模糊划分的扩展）和Frobenius调整兰德指数，<sup>[17](https://arxiv.org/html/2312.10270v1)</sup> 德沃尔夫和安德鲁斯（2025）提出了用于硬聚类和模糊聚类ARI计算的新随机模型，并指出所需的随机模型选择往往被隐含处理。<sup>[18](https://doi.org/10.1007/s11634-025-00625-w)</sup> 沃伦斯（2008）表明，ARI也可以通过构建不匹配表并在其上计算Cohen's κ来获得。<sup>[19](https://doi.org/10.1007/s00357-008-9023-7)</sup>

## 应用

ARI有两个主要作用。作为外部效度指数，它对聚类与参考标签进行评分；在单细胞RNA测序中，它与NMI是衡量计算聚类与已知细胞类型之间一致性的标准选择。<sup>[2](https://link.springer.com/article/10.1186/s13059-020-02027-x)</sup> 作为共识指数，它评估聚类算法在重叠子样本上的平均稳定性；scikit-learn的指导是，只有调整后的度量才能安全地以此方式使用，因为非调整度量对细粒度随机标签会输出很大的值。<sup>[20](https://scikit-learn.org/stable/auto%5Fexamples/cluster/plot_adjusted_for_chance_measures.html)</sup> ARI与AMI之间的选择取决于参考的结构：当参考具有大而等大的簇时用ARI，当参考不平衡且簇较小时用AMI。<sup>[5](https://jmlr.org/papers/volume17/15-627/15-627.pdf)</sup>

## 局限与替代方案

ARI是簇级调整沃莱斯指数的加权平均，权重是簇大小的二次函数，因此在簇大小不平衡时，它主要反映大簇上的一致性，对小簇提供的信息少得多。<sup>[3](https://arxiv.org/pdf/1901.01777v1.pdf)</sup> 这就是针对不平衡参考的ARI对AMI选用指南背后的实际原因。<sup>[5](https://jmlr.org/papers/volume17/15-627/15-627.pdf)</sup>

超几何期望本身是一种建模选择。它强制固定簇的大小，忽略抽样的随机性，并且当两个聚类相关时不适用。<sup>[15](https://ar5iv.labs.arxiv.org/html/2011.08708)</sup> 盖茨和安表明，随机模型的选择可能极大地改变相似聚类对的排名以及相对于随机基线的评价，并建议将模型与算法相匹配；例如，K-means固定的是簇的数量而非大小。<sup>[21](https://www.jmlr.org/papers/volume18/17-039/17-039.pdf)</sup>

负值是已知特性而非错误：当一致性低于在保持边际的随机分配下的预期时，ARI可以取负值。<sup>[8](https://link.springer.com/article/10.1007/s11634-022-00491-w)</sup> 如果允许簇大小变化，可能的最小值为−1/2，由含一个零元素且其余元素均为1的2×2列联矩阵达到；对于两个等大小的聚类 \( r = s \ge 2 \)，最小值为 \( -r/(3r-2) \)，因此随着 \( r \) 增大，范围趋近于 \( [-1/3, 1] \)。<sup>[8](https://link.springer.com/article/10.1007/s11634-022-00491-w)</sup>

## References

1. [adjusted_rand_score, scikit-learn documentation](https://sklearn.org/stable/modules/generated/sklearn.metrics.adjusted_rand_score.html)
2. [Accounting for cell type hierarchy in evaluating single cell RNA-seq clustering (Genome Biology 2020)](https://link.springer.com/article/10.1186/s13059-020-02027-x)
3. [Understanding the Adjusted Rand Index and Other Partition Comparison Indices Based on Counting Object Pairs (Warrens & Van der Hoef; published Journal of Classification 39(3):487-509, 2022, DOI 10.1007/s00357-022-09413-z)](https://arxiv.org/pdf/1901.01777v1.pdf)
4. [Supplement (Yeung et al.): The Adjusted Rand index for comparing clustering to external criteria](https://faculty.washington.edu/kayee/pca/supp.pdf)
5. [Adjusting for Chance Clustering Comparison Measures (Romano, Vinh, Bailey, Verspoor, JMLR 2016)](https://jmlr.org/papers/volume17/15-627/15-627.pdf)
6. [aricode R package reference manual (CRAN)](https://cran.r-project.org/web/packages/aricode/refman/aricode.html)
7. [Unifying Information-Theoretic and Pair-Counting Clustering Similarity (arXiv:2511.03000, November 2025)](https://arxiv.org/html/2511.03000)
8. [Minimum adjusted Rand index for two clusterings of a given size (Chacón & Rastrojo)](https://link.springer.com/article/10.1007/s11634-022-00491-w)
9. [Empirical Study of Partitions Similarity Measures (Santos & Ramos, 2010)](https://research.gold.ac.uk/id/eprint/30945/1/Paper.pdf)
10. [Adjusted Rand Index Calculator (ARI, Rand, Fowlkes–Mallows)](https://induwara.lk/tools/adjusted-rand-index-calculator)
11. [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)
12. [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)
13. [Lawrence Hubert, Phipps Arabie (1985). Comparing partitions. Journal of Classification.](https://doi.org/10.1007/bf01908075)
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. [Adjusting the adjusted Rand Index, A multinomial story (Sundqvist, Chiquet, Rigaill; arXiv 2011.08708)](https://ar5iv.labs.arxiv.org/html/2011.08708)
16. [Sundqvist, Chiquet & Rigaill (2023), 'Adjusting the adjusted Rand Index', Computational Statistics 38(1):327-347 (bibliographic record)](https://ideas.repec.org/a/spr/compst/v38y2023i1d10.1007_s00180-022-01230-7.html)
17. [Random Models for Fuzzy Clustering Similarity Measures (arXiv, December 2023)](https://arxiv.org/html/2312.10270v1)
18. [Ryan DeWolfe, Jeffrey L. Andrews (2025). Random models for adjusting fuzzy rand index extensions. Advances in Data Analysis and Classification.](https://doi.org/10.1007/s11634-025-00625-w)
19. [Matthijs J. Warrens (2008). On the Equivalence of Cohen’s Kappa and the Hubert-Arabie Adjusted Rand Index. Journal of Classification.](https://doi.org/10.1007/s00357-008-9023-7)
20. [Adjustment for chance in clustering performance evaluation, scikit-learn example](https://scikit-learn.org/stable/auto%5Fexamples/cluster/plot_adjusted_for_chance_measures.html)
21. [The Impact of Random Models on Clustering Similarity (Gates & Ahn, JMLR 2017)](https://www.jmlr.org/papers/volume18/17-039/17-039.pdf)

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

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

Copyright 2026 Edgepedia

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

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

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