# 共识聚类

共识聚类是一种基于重采样的聚类方法，它通过对数据集的扰动版本反复进行聚类并汇总结果，来评估聚类分配的稳定性。它不返回单一的聚类结果，而是生成一个共识矩阵，记录每一对项目被聚到同一类的频率；由此得出一个最终的共识聚类；以及诸如共识CDF和PAC分数之类的诊断指标，用以指示哪个聚类数最为稳定。<sup>[1](https://link.springer.com/article/10.1023/A:1023949509487)</sup><sup> • </sup><sup>[2](https://pmc.ncbi.nlm.nih.gov/articles/PMC2881355/)</sup> 该方法最初为基因表达微阵列的类别发现而提出，如今已广泛应用于癌症亚型分型和单细胞基因组学。<sup>[1](https://link.springer.com/article/10.1023/A:1023949509487)</sup><sup> • </sup><sup>[3](https://www.nature.com/articles/srep06207)</sup>

| 关键事实 | 详情 |
|---|---|
| 原始论文 | Monti、Tamayo、Mesirov 和 Golub，Machine Learning 52:91–118，2003<sup>[1](https://link.springer.com/article/10.1023/A:1023949509487)</sup> |
| 主要输出 | 一个 N × N 的共识矩阵，记录两两共聚类频率，以及每个 K 对应的一个共识聚类<sup>[1](https://link.springer.com/article/10.1023/A:1023949509487)</sup> |
| 典型重采样 | 无放回子采样，每次迭代取 80% 的项目；Monti 使用了 \( H = 500 \) 次迭代<sup>[1](https://link.springer.com/article/10.1023/A:1023949509487)</sup> |
| K 选择指标 | CDF 增量面积、Δ(K) 和 PAC（模糊聚类比例）<sup>[3](https://www.nature.com/articles/srep06207)</sup><sup> • </sup><sup>[4](https://link.springer.com/article/10.1186/1471-2105-11-590)</sup> |
| 主要 R 实现 | ConsensusClusterPlus（2010）、M3C（2020）、clusterCons、ConsensusClustering（2024）<sup>[2](https://pmc.ncbi.nlm.nih.gov/articles/PMC2881355/)</sup><sup> • </sup><sup>[5](https://doi.org/10.1038/s41598-020-58766-1)</sup><sup> • </sup><sup>[4](https://link.springer.com/article/10.1186/1471-2105-11-590)</sup><sup> • </sup><sup>[6](https://cran.r-project.org/web/packages/ConsensusClustering/refman/ConsensusClustering.html)</sup> |
| 已知失效模式 | 在无聚类结构的数据上表现出表面稳定性、偏向更高的 K、计算成本高<sup>[3](https://www.nature.com/articles/srep06207)</sup><sup> • </sup><sup>[5](https://doi.org/10.1038/s41598-020-58766-1)</sup> |
| 实用规模 | 在数百到约一千个项目上可靠；M3C 推荐用于大约 60–1000 个样本<sup>[5](https://doi.org/10.1038/s41598-020-58766-1)</sup> |

## 工作原理

该方法基于一个采样变异性假设：如果项目来自不同的子群体，那么从同一批子群体中抽取的不同样本应当产生组成和数目基本相同的聚类。<sup>[1](https://link.springer.com/article/10.1023/A:1023949509487)</sup> 因此，对数据的许多扰动版本重新聚类，可以衡量哪些分配能够经受住采样噪声。

汇总的产物是共识矩阵，一个 N × N 矩阵，其元素 (i, j) 存储项目 i 和 j 被聚到同一类的聚类运行比例，通过对所有扰动数据集的连接矩阵取平均、并按每对被共同采样的次数归一化得到。<sup>[1](https://link.springer.com/article/10.1023/A:1023949509487)</sup><sup> • </sup><sup>[5](https://doi.org/10.1038/s41598-020-58766-1)</sup> 其经验累积分布函数（CDF）图，连同跨 K 值的 CDF 曲线下面积一起考察，可作为稳定性诊断：面积增长出现平台提示一个候选 K，不过这表示的是稳定性，而非证明进一步划分不反映任何真实的聚类结构。<sup>[2](https://pmc.ncbi.nlm.nih.gov/articles/PMC2881355/)</sup> 同样的汇总逻辑也可以应用于单一算法（如 k-means 或 SOM）的多次随机重启，以考虑对初始条件的敏感性。<sup>[1](https://link.springer.com/article/10.1023/A:1023949509487)</sup>

## 操作步骤

1. 选择基础聚类算法、距离度量、子采样比例以及候选聚类数 K 的范围。ConsensusClusterPlus 的默认值为 maxK = 3、reps = 10、pItem = 0.8、pFeature = 1，以及层次聚类，但教程建议实践中使用约 1,000 次重复，最大 K 可达 20。<sup>[7](https://bioconductor.posit.co/packages/3.24/bioc/manuals/ConsensusClusterPlus/man/ConsensusClusterPlus.pdf)</sup><sup> • </sup><sup>[8](https://bioconductor.statistik.uni-dortmund.de/packages/3.24/bioc/vignettes/ConsensusClusterPlus/inst/doc/ConsensusClusterPlus.pdf)</sup> 关于最大 K 的经验法则是样本量的平方根。<sup>[9](https://rdrr.io/github/dswatson/M3C/src/R/consensus.R)</sup>
2. 对每个 K，运行 H 次重采样迭代。每个扰动数据集通过无放回地采样一定比例的项目（Monti 使用 80%）以及可选的、一定比例的特征来创建。<sup>[1](https://link.springer.com/article/10.1023/A:1023949509487)</sup><sup> • </sup><sup>[2](https://pmc.ncbi.nlm.nih.gov/articles/PMC2881355/)</sup>
3. 用所选算法将每个扰动数据集聚为 K 组，并记录哪些项目对被聚到一起。<sup>[2](https://pmc.ncbi.nlm.nih.gov/articles/PMC2881355/)</sup>
4. 通过对求和后的连接矩阵进行归一化，为每个 K 构建共识矩阵：每个单元格是两个项目被聚到一起的次数除以它们被共同采样的次数。<sup>[5](https://doi.org/10.1038/s41598-020-58766-1)</sup><sup> • </sup><sup>[4](https://link.springer.com/article/10.1186/1471-2105-11-590)</sup>
5. 对每个 K，使用距离 \( 1 - \text{共识值} \) 执行一次最终的凝聚层次聚类，并将树剪枝为 K 个共识簇。<sup>[2](https://pmc.ncbi.nlm.nih.gov/articles/PMC2881355/)</sup>
6. 使用诊断指标选择 K：增量面积图显示从 \( K - 1 \) 到 \( K \) 的 CDF 曲线下面积的相对变化，通常检查该增量是否趋于平缓或出现肘部，而非在最优 K 处出现峰值；而 PAC，即共识值落在 [0, 1] 的某个中间子区间内的样本对比例，在最优 K 处最小化，因为低 PAC 意味着 CDF 的中间段平坦。<sup>[8](https://bioconductor.statistik.uni-dortmund.de/packages/3.24/bioc/vignettes/ConsensusClusterPlus/inst/doc/ConsensusClusterPlus.pdf)</sup><sup> • </sup><sup>[4](https://link.springer.com/article/10.1186/1471-2105-11-590)</sup><sup> • </sup><sup>[3](https://www.nature.com/articles/srep06207)</sup>

ConsensusClusterPlus 支持的距离包括 Pearson（1 − Pearson 相关系数）、Spearman、欧几里得、二元、最大值、堪培拉和闵可夫斯基距离，以及自定义距离函数和自定义聚类算法；可以提供预先计算的距离矩阵，以加快在数千个项目上的运行速度。<sup>[8](https://bioconductor.statistik.uni-dortmund.de/packages/3.24/bioc/vignettes/ConsensusClusterPlus/inst/doc/ConsensusClusterPlus.pdf)</sup>

## 起源

共识聚类由 Stefano Monti、Pablo Tamayo、Jill Mesirov 和 Todd Golub 在《共识聚类：一种基于重采样的基因表达微阵列数据类别发现与可视化方法》（Machine Learning，第 52 卷，第 91–118 页，2003 年）中提出。<sup>[1](https://link.springer.com/article/10.1023/A:1023949509487)</sup> 该论文建立在早期基于重采样的验证工作之上：自助法（bootstrapping）被引入以评估层次聚类的稳定性，论文还引用了 Ben-Hur、Elisseeff 和 Guyon（2002）、Dudoit 和 Fridlyand（2002）、Levine 和 Domany（2001）、Jain 和 Moreau（1988）以及 Tibshirani 及其同事（2001）的工作。<sup>[1](https://link.springer.com/article/10.1023/A:1023949509487)</sup>

Monti 的设计在重采样方案上不同于基于 bagging 的聚类：自助法重复样本包含完全相同的重复项目，这会人为地夸大数据的紧凑性，因此该方法改为无放回地采样项目。<sup>[1](https://link.springer.com/article/10.1023/A:1023949509487)</sup> 一条平行的工作路线，即 Alexander Strehl 和 Joydeep Ghosh（2002）的聚类集成框架，将同一数据的多个划分组合成一个中位划分；该形式作为优化问题是 NP 完全的。<sup>[10](https://www.cs.ucdavis.edu/~filkov/papers/consensuseval.pdf)</sup> Simpson、Armstrong 和 Jarman 后来在他们综述的方法中，将 Monti 的方法描述为唯一一种通用的、模型无关的、用于评估聚类稳定性的重采样方法。<sup>[4](https://link.springer.com/article/10.1186/1471-2105-11-590)</sup> 到 2014 年，这篇 2003 年的论文已被引用约 600 次，癌症基因组图谱（The Cancer Genome Atlas）曾用它识别出四种胶质母细胞瘤亚型。<sup>[3](https://www.nature.com/articles/srep06207)</sup>

## 变体

**ConsensusClusterPlus**（Matthew D. Wilkerson 和 D. Neil Hayes，Bioinformatics 2010）在 R 中实现了 Monti 算法，并增加了项目追踪、项目共识图和簇共识图、可按基因变异性等分布加权的二维项目与特征子采样，以及对自定义算法的支持。<sup>[2](https://pmc.ncbi.nlm.nih.gov/articles/PMC2881355/)</sup> GenePattern 2.0（Michael Reich 及其同事，Nature Genetics 2006）托管了一个面向非程序员的共识聚类实现。<sup>[11](https://doi.org/10.1038/ng0506-500)</sup>

**M3C**（Christopher R. John、David Watson、Dominic Russ 及其同事，Scientific Reports 2020）将 Monti 算法包裹在一个蒙特卡洛参考框架中：它从无结构的参考数据模拟 PAC 分数的零分布，拟合 beta 分布以估计尾部 p 值，从而能够对零假设 \( K = 1 \) 进行正式检验。其内部算法为 PAM（默认）、k-means 和自调谐谱聚类。<sup>[5](https://doi.org/10.1038/s41598-020-58766-1)</sup>

**clusterCons**（Simpson、Armstrong 和 Jarman，2010）通过加权平均（权重可由用户在 [0, 1] 内指定）合并来自多个聚类算法和参数设置的共识矩阵。<sup>[4](https://link.springer.com/article/10.1186/1471-2105-11-590)</sup> **Fast Consensus**（Raffaele Giancarlo 和 Filippo Utro，2011）使用层次或层次初始化的划分算法，以至少快一个数量级的速度近似 Monti 流程，同时保持相同的精度。<sup>[12](https://almob.biomedcentral.com/counter/pdf/10.1186/1748-7188-6-1.pdf)</sup> **MPCC** 从仅含 25% 观测和 10% 特征的微小“小片”（minipatch）构建集成，将主导成本降至 \( O(N^{2}) \)；其变体 IMPACC 增加了基于方差分析的自适应特征采样以提高可解释性。<sup>[13](https://journals.plos.org/ploscompbiol/article?id=10.1371%2Fjournal.pcbi.1010577)</sup> **ConsensusClustering** R 包实现了数据扰动、多视图和多数投票三种共识机制，并可通过 LogitScore、PAC、deltaA 和 CMavg 进行聚类数选择。<sup>[6](https://cran.r-project.org/web/packages/ConsensusClustering/refman/ConsensusClustering.html)</sup> 对于单细胞数据，**SC3**（Kiselev 及其同事，Nature Methods 2017）对多种降维结果进行 k-means 聚类，再汇总为共识聚类，<sup>[14](https://doi.org/10.1038/nmeth.4236)</sup> 而 **CHAI** 通过二元相似矩阵汇总七种 scRNA-seq 算法，并提供平均相似度变体和 CHAI-SNF 变体。<sup>[15](https://pmc.ncbi.nlm.nih.gov/articles/PMC10983883/)</sup> **Untangled** 在 0.2 到 20 的分辨率范围内以 0.2 为步长运行 Seurat 的 Louvain 聚类，将分配结果汇总为共识矩阵，并通过 Ward 聚类结合轮廓系数平台检测（默认范围 2–300 个簇）来选择簇数；在金标准 PBMC 和模拟数据集上，它比 SC3、RSEC、SAFE、SAME 和 ConsensusClusterPlus 获得了更高的簇纯度。<sup>[16](https://www.ovid.com/journals/brbio/fulltext/10.1093/bib/bbag242~a-scalable-multi-resolution-consensus-clustering-approach)</sup>

## 应用

最主要的应用是癌症分子亚型分型。TCGA 在胶质母细胞瘤基因表达数据上使用共识聚类，识别出四种亚型，<sup>[3](https://www.nature.com/articles/srep06207)</sup> 而 ConsensusClusterPlus 的教程文档引用了 Hayes 及其同事（2006）关于肺腺癌和 Verhaak 及其同事（2010）关于胶质母细胞瘤的工作，作为使用该方法发现新分子亚类的例子。<sup>[8](https://bioconductor.statistik.uni-dortmund.de/packages/3.24/bioc/vignettes/ConsensusClusterPlus/inst/doc/ConsensusClusterPlus.pdf)</sup> 在单细胞 RNA-seq 中，SC3 是一种流行的方法，它通过计算细胞间的多个距离矩阵、经由 PCA 和图拉普拉斯变换对其进行变换，并汇总从这些变换表示中获得的 k-means 聚类来实施共识聚类，<sup>[13](https://journals.plos.org/ploscompbiol/article?id=10.1371%2Fjournal.pcbi.1010577)</sup> 而 CHAI 通过融合来自七种算法的相似矩阵对其加以扩展；其 CHAI-SNF 变体建立在相似网络融合（Similarity Network Fusion）之上，后者最初是为了在群体水平的多组学亚型分型中整合 mRNA、DNA 甲基化和 miRNA 患者相似矩阵而创建的，CHAI 还可以额外纳入空间转录组学或 ATAC-seq 数据。<sup>[15](https://pmc.ncbi.nlm.nih.gov/articles/PMC10983883/)</sup>

## 局限与替代方案

**稳定性不等于真相。** 模拟表明，共识聚类可以将随机生成的单峰、无聚类结构的数据在一定 K 范围内划分为看似稳定的簇，而常见实现在具有已知结构的数据上难以正确识别真实的 K。<sup>[3](https://www.nature.com/articles/srep06207)</sup> Şenbabaoğlu、Michailidis 和 Li 建议不要仅依赖共识矩阵热图，而应使用具有相同基因-基因相关性的模拟单峰数据对簇强度进行正式检验，并将共识聚类与其他集成方法结合使用。<sup>[3](https://www.nature.com/articles/srep06207)</sup>

**偏向更高的 K。** 由于 PAC 和原始的增量面积准则未与零参考分布进行比较，Monti 算法存在偏向更高 K 的偏差，并产生大量假阳性；M3C 通过蒙特卡洛参考检验解决了这一问题。<sup>[5](https://doi.org/10.1038/s41598-020-58766-1)</sup> 在已知 K 的模拟数据上，PAC 优于 CDF、Δ(K)、轮廓宽度、GAP-PC 和 CLEST。<sup>[3](https://www.nature.com/articles/srep06207)</sup> 另一项独立评估发现，包括共识聚类在内的基于稳定性的度量在选择聚类数方面始终优于非基于稳定性的 KL、轮廓、GAP 和 JUMP 度量。<sup>[17](https://thesis.eur.nl/pub/53543/A-Critical-Evaluation-of-Stability-based-Measures-for-the-Selection-of-the-Number-of-Clusters-449580-.pdf)</sup>

**样本量与基础算法。** 共识聚类在数百个项目的中小型数据集上预测正确聚类数非常可靠，尤其是使用层次基础算法时。<sup>[12](https://almob.biomedcentral.com/counter/pdf/10.1186/1748-7188-6-1.pdf)</sup> 平均链接的层次聚类作为基础方法不可靠，因为在第 K 层切割树状图常常将离群样本分配到小型或单例簇中。<sup>[3](https://www.nature.com/articles/srep06207)</sup> 共识聚类的渐近选择一致性尚未确立，它可能终止于局部最优。<sup>[17](https://thesis.eur.nl/pub/53543/A-Critical-Evaluation-of-Stability-based-Measures-for-the-Selection-of-the-Number-of-Clusters-449580-.pdf)</sup>

**计算成本。** 共识聚类是最慢的内部验证方法之一，与最快的方法（WCSS）相比时间差距至少两个数量级；在一项基准测试中，一些运行在四天后被停止，或者本需要数周才能完成。<sup>[12](https://almob.biomedcentral.com/counter/pdf/10.1186/1748-7188-6-1.pdf)</sup> M3C 的运行时间根据数据集大小从约 2 到 25 分钟不等，在超过 500 个样本时比其他方法更慢，其文档仅推荐用于大约 60–1000 个样本的数据集，不适用于单细胞数据。<sup>[5](https://doi.org/10.1038/s41598-020-58766-1)</sup> N × N 共识矩阵是反复出现的瓶颈：Untangled 报告，在样本数超过 100,000 时会出现这一瓶颈。<sup>[16](https://www.ovid.com/journals/brbio/fulltext/10.1093/bib/bbag242~a-scalable-multi-resolution-consensus-clustering-approach)</sup> 作为优化问题，共识聚类的中位划分形式是 NP 完全的，精确求解器仍局限于不超过数百个样本的实例。<sup>[10](https://www.cs.ucdavis.edu/~filkov/papers/consensuseval.pdf)</sup><sup> • </sup><sup>[18](https://www.sciencedirect.com/science/article/abs/pii/S0957417419300892)</sup>

## References

1. [Consensus Clustering: A Resampling-Based Method for Class Discovery and Visualization of Gene Expression Microarray Data (Monti, Tamayo, Mesirov & Golub, Machine Learning 2003)](https://link.springer.com/article/10.1023/A:1023949509487)
2. [ConsensusClusterPlus: a class discovery tool with confidence assessments and item tracking (Wilkerson & Hayes, Bioinformatics 2010)](https://pmc.ncbi.nlm.nih.gov/articles/PMC2881355/)
3. [Critical limitations of consensus clustering in class discovery (Şenbabaoğlu, Michailidis & Li, Scientific Reports 2014; bioRxiv preprint versions merged here)](https://www.nature.com/articles/srep06207)
4. [Merged consensus clustering to assess and improve class discovery with microarray data (Simpson et al., BMC Bioinformatics 2010)](https://link.springer.com/article/10.1186/1471-2105-11-590)
5. [Christopher R. John and colleagues (2020). M3C: Monte Carlo reference-based consensus clustering. Scientific Reports.](https://doi.org/10.1038/s41598-020-58766-1)
6. [ConsensusClustering R package reference manual (CRAN, v1.5.0)](https://cran.r-project.org/web/packages/ConsensusClustering/refman/ConsensusClustering.html)
7. [ConsensusClusterPlus package manual (v1.77.0)](https://bioconductor.posit.co/packages/3.24/bioc/manuals/ConsensusClusterPlus/man/ConsensusClusterPlus.pdf)
8. [ConsensusClusterPlus Tutorial (Bioconductor vignette)](https://bioconductor.statistik.uni-dortmund.de/packages/3.24/bioc/vignettes/ConsensusClusterPlus/inst/doc/ConsensusClusterPlus.pdf)
9. [dswatson/M3C source: R/consensus.R](https://rdrr.io/github/dswatson/M3C/src/R/consensus.R)
10. [Consensus Clustering Algorithms: Comparison and Refinement (Filkov & Skiena)](https://www.cs.ucdavis.edu/~filkov/papers/consensuseval.pdf)
11. [Michael Reich and colleagues (2006). GenePattern 2.0. Nature Genetics.](https://doi.org/10.1038/ng0506-500)
12. [Speeding up the Consensus Clustering methodology for microarray data analysis, Fast Consensus (Giancarlo & Utro, Algorithms for Molecular Biology 2011)](https://almob.biomedcentral.com/counter/pdf/10.1186/1748-7188-6-1.pdf)
13. [Fast and interpretable consensus clustering via minipatch learning (MPCC, PLOS Computational Biology)](https://journals.plos.org/ploscompbiol/article?id=10.1371%2Fjournal.pcbi.1010577)
14. [Vladimir Yu Kiselev and colleagues (2017). SC3: consensus clustering of single-cell RNA-seq data. Nature Methods.](https://doi.org/10.1038/nmeth.4236)
15. [CHAI: Consensus Clustering Through Similarity Matrix Integration for Cell-Type Identification](https://pmc.ncbi.nlm.nih.gov/articles/PMC10983883/)
16. [A scalable, multi-resolution consensus clustering approach (Untangled), Briefings in Bioinformatics](https://www.ovid.com/journals/brbio/fulltext/10.1093/bib/bbag242~a-scalable-multi-resolution-consensus-clustering-approach)
17. [A Critical Evaluation of Stability-based Measures for the Selection of the Number of Clusters (Erasmus University thesis)](https://thesis.eur.nl/pub/53543/A-Critical-Evaluation-of-Stability-based-Measures-for-the-Selection-of-the-Number-of-Clusters-449580-.pdf)
18. [Estimating the number of clusters in a dataset via consensus clustering (Expert Systems with Applications, 2019)](https://www.sciencedirect.com/science/article/abs/pii/S0957417419300892)

---
*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/consensus-clustering

English original: https://www.edgepedia.org/consensus-clustering
