# 概率聚类

概率聚类是一类无监督方法，它用一个概率模型——通常是有限混合模型——拟合数据，并通过后验隶属概率而不是单一硬标签把每个点分配给簇。每个观测得到一个责任度向量，各分量之和为一，因此关于隶属关系的不确定性会被传递到下游分析中，而不是被丢弃。这种软分配避免了把靠近簇边界的点强行完全归入某一簇时产生的偏差，并且为每个点给出分类不确定性的直接度量。<sup>[1](https://mclust-org.github.io/mclust-book/chapters/02_mixture.html)</sup><sup> • </sup><sup>[2](https://gwern.net/doc/statistics/probability/2019-mclachlan.pdf)</sup>

| 关键事实 | 说明 |
|---|---|
| 输出 | 每个点的后验隶属概率（责任度）；分类不确定性 \( u_i = 1 - \max_k \hat{z}_{ik} \in [0,1] \)<sup>[1](https://mclust-org.github.io/mclust-book/chapters/02_mixture.html)</sup> |
| 标准拟合算法 | 期望最大化（EM）；即使对单变量高斯混合，也不存在闭式最大似然估计<sup>[3](https://journal.r-project.org/articles/RJ-2023-043/RJ-2023-043.pdf)</sup> |
| 与 k-means 的关系 | 当各分量具有相同的球形协方差 \( \sigma^2 I \) 且混合比例相等时，高斯混合是 k-means 的软版本；当 \( \sigma^2 \to 0 \) 时，k-means 是其极限<sup>[2](https://gwern.net/doc/statistics/probability/2019-mclachlan.pdf)</sup><sup> • </sup><sup>[4](https://www.sciencedirect.com/science/article/abs/pii/S0167865519301126)</sup> |
| EM 的奠基论文 | A. P. 登普斯特（A. P. Dempster）、N. M. 莱尔德（N. M. Laird）和 D. B. 鲁宾（D. B. Rubin），JRSS-B 39(1)，1977<sup>[5](https://doi.org/10.1111/j.2517-6161.1977.tb01600.x)</sup> |
| 主要失效模式 | 似然无界：分量可能坍缩到少数点，方差接近零<sup>[6](https://www.nature.com/articles/s41598-023-44608-3)</sup> |
| 模型选择 | BIC（倾向于高估簇数）、ICL（带熵惩罚，偏好分离良好的簇）、AIC（往往大幅高估）<sup>[1](https://mclust-org.github.io/mclust-book/chapters/02_mixture.html)</sup><sup> • </sup><sup>[7](https://dr.lib.iastate.edu/server/api/core/bitstreams/333bb46d-c759-4202-8f41-0e921271de53/content)</sup> |
| 软件 | mclust、EMMIX、mixtools、FlexMix（R）；GaussianMixture 与 BayesianGaussianMixture（scikit-learn）<sup>[2](https://gwern.net/doc/statistics/probability/2019-mclachlan.pdf)</sup><sup> • </sup><sup>[8](https://scikit-learn.org/stable/modules/mixture)</sup> |

## 工作原理

生成模型假定每个观测 \( x_i \) 的抽取过程是：先以混合权重 \( \pi_k > 0 \) 选取潜在簇标签 \( z_i = k \)，其中 \( \sum_k \pi_k = 1 \)，再从分量密度 \( f_k(x; \theta_k) \) 中抽取 \( x_i \)，得到混合密度 \( f(x) = \sum_k \pi_k f_k(x; \theta_k) \)。<sup>[9](https://www.stat.cmu.edu/~cshalizi/402/lectures/19-mixtures/lecture-19.pdf)</sup> 在[高斯混合模型](https://www.edgepedia.org/zh/gaussian-mixture-model)（GMM）中，每个 \( f_k \) 都是多元正态分布，各有自己的均值和协方差。由于分量标签不可观测，对数似然在对数内部包含对分量的求和，因此即使对基本的单变量 GMM，也不存在闭式最大似然估计。<sup>[3](https://journal.r-project.org/articles/RJ-2023-043/RJ-2023-043.pdf)</sup><sup> • </sup><sup>[10](https://mlg.eng.cam.ac.uk/zoubin/tut06/Bishop-CUED-2006.pdf)</sup>

EM 通过把标签视为缺失数据来解决这一问题。E 步计算责任度，即在给定当前参数时分量隶属的后验概率：

\[ \hat{z}_{ik}^{(t)} = \frac{\pi_k^{(t)} f_k(x_i; \theta_k^{(t)})}{\sum_{j=1}^G \pi_j^{(t)} f_j(x_i; \theta_j^{(t)})}. \]

M 步最大化期望完全数据对数似然；对 GMM，混合比例更新为 \( \hat{\pi}_k = n_k/n \)，其中 \( n_k = \sum_i \hat{z}_{ik} \)，均值更新为加权平均 \( \hat{\mu}_k = \sum_i \hat{z}_{ik} x_i / n_k \)。<sup>[1](https://mclust-org.github.io/mclust-book/chapters/02_mixture.html)</sup> 每一轮 EM 循环都保证不会降低似然，因此迭代收敛到局部极大值或驻点。<sup>[9](https://www.stat.cmu.edu/~cshalizi/402/lectures/19-mixtures/lecture-19.pdf)</sup><sup> • </sup><sup>[10](https://mlg.eng.cam.ac.uk/zoubin/tut06/Bishop-CUED-2006.pdf)</sup>

## 实施方式

实践者首先选择分量族和协方差参数化。mclust 框架使用 14 种协方差模型，这些模型通过对各分量的体积、形状和方向施加约束得到；其中五种模型（VEI、VEE、VEV、EVE、VVE）没有闭式更新，需用迭代方法。<sup>[1](https://mclust-org.github.io/mclust-book/chapters/02_mixture.html)</sup> scikit-learn 支持对角、球形、绑定和完全协方差。<sup>[8](https://scikit-learn.org/stable/modules/mixture)</sup>

初始化很重要，因为似然有许多局部极大值。可选方法包括 k-means、k-means++、随机数据点、从全局均值扰动，以及基于模型的凝聚层次聚类（mclust 的默认方法）。<sup>[8](https://scikit-learn.org/stable/modules/mixture)</sup><sup> • </sup><sup>[1](https://mclust-org.github.io/mclust-book/chapters/02_mixture.html)</sup> 一项 2023 年对七个 R 包的基准测试发现，当分量分离良好时，REBMIX 初始化估计效果最好；当分量高度重叠时，k-means 或随机初始化表现最好；没有一种初始化方法能始终优于其他方法。<sup>[3](https://journal.r-project.org/articles/RJ-2023-043/RJ-2023-043.pdf)</sup><sup> • </sup><sup>[7](https://dr.lib.iastate.edu/server/api/core/bitstreams/333bb46d-c759-4202-8f41-0e921271de53/content)</sup> 拟合通过 EM 进行直至达到收敛容差，模型选择则在模型 \( M \) 和分量数 \( G \) 之间比较 BIC，\( \mathrm{BIC}_{M,G} = 2\ell_{M,G}(\hat{\Psi}; x) - \nu_{M,G} \log(n) \)。<sup>[1](https://mclust-org.github.io/mclust-book/chapters/02_mixture.html)</sup> 由于 BIC 偏好良好的密度估计，它倾向于高估簇数，这促使了积分分类似然（ICL）准则的提出；ICL 用衡量簇重叠的熵项惩罚 BIC；AIC 通常大幅高估 \( K \)，而 BIC 在小样本量下可能低估 \( K \)。<sup>[2](https://gwern.net/doc/statistics/probability/2019-mclachlan.pdf)</sup><sup> • </sup><sup>[7](https://dr.lib.iastate.edu/server/api/core/bitstreams/333bb46d-c759-4202-8f41-0e921271de53/content)</sup>

## 起源

EM 算法由 A. P. 登普斯特、N. M. 莱尔德和 D. B. 鲁宾以《从不完整数据通过 EM 算法求最大似然》为题发表于 1977 年的《皇家统计学会杂志 B 辑》；其名称来自期望步和最大化步，该文将有限混合模型列为例子之一。<sup>[5](https://doi.org/10.1111/j.2517-6161.1977.tb01600.x)</sup> 正如该文所记载，用于混合模型的 EM 算法此前已被独立推导出来，遗传学中也有更早的部分理论。<sup>[5](https://doi.org/10.1111/j.2517-6161.1977.tb01600.x)</sup> 约翰·H·沃尔夫（John H. Wolfe）1965 年的报告《类型最大似然分析计算机程序》在计算上实现了混合模型聚类。<sup>[11](https://doi.org/10.21236/ad0620026)</sup> 更早的混合分析包括对双正态混合的矩方法拟合（需要求解一个九次多项式），以及一种可视为 EM 应用的迭代重加权方案。<sup>[2](https://gwern.net/doc/statistics/probability/2019-mclachlan.pdf)</sup> 用于基于模型聚类的 mclust 软件由克里斯·弗雷利（Chris Fraley）和[阿德里安·E·拉夫特里](https://www.edgepedia.org/zh/adrian-e-raftery)（Adrian E. Raftery）于 1999 年发表于《分类杂志》。<sup>[12](https://doi.org/10.1007/s003579900058)</sup>

## 变体

**贝叶斯与非参数混合。** 贝叶斯 GMM 对参数放置先验（混合权重上的狄利克雷先验，均值和精度上的正态-威沙特先验），并通过变分推断拟合；变分推断最大化模型证据的下界，而不是似然；scikit-learn 的 BayesianGaussianMixture 同时支持有限狄利克雷权重先验和[狄利克雷过程](https://www.edgepedia.org/zh/dirichlet-process)（折棍）权重先验。<sup>[10](https://mlg.eng.cam.ac.uk/zoubin/tut06/Bishop-CUED-2006.pdf)</sup><sup> • </sup><sup>[8](https://scikit-learn.org/stable/modules/mixture)</sup> 卡尔·爱德华·拉斯穆森（Carl Edward Rasmussen，1999）的无限高斯混合模型通过使用狄利克雷过程混合绕开了分量数的选择，其推断通过无参数的吉布斯采样马尔可夫链进行，能自动确定所表示的类别数，并避免困扰 EM 的局部极小值。<sup>[13](https://proceedings.neurips.cc/paper/1999/file/97d98119037c5b8a9663cb21fb8ebf47-Paper.pdf)</sup> DPMUnc 将 DPGMM 扩展为使用逐观测不确定性，把观测建模为潜变量的含噪版本。<sup>[14](https://journals.plos.org/ploscompbiol/article?id=10.1371%2Fjournal.pcbi.1012301)</sup>

**硬分配近亲。** 硬 EM、用于 GMM 的分类 EM（CEM）以及用于隐马尔可夫模型的维特比训练，都用硬分配替代软责任度。<sup>[4](https://www.sciencedirect.com/science/article/abs/pii/S0167865519301126)</sup>

**摊销推断。** 由伊里特·切利（Irit Chelly）及其同事于 2025 年在 arXiv 上提出的 GFNCP，将聚类视为一个生成流网络，其流匹配条件等价于聚类后验在边缘化下的一致性，蕴含顺序不变性，并优于包括神经聚类过程在内的先前摊销方法。<sup>[15](https://doi.org/10.48550/arxiv.2502.19337)</sup>

## 应用

混合模型应用于农业、天文学、生物信息学、生物学、经济学、工程学、遗传学、成像、市场营销、医学、神经科学、精神病学和心理学。<sup>[2](https://gwern.net/doc/statistics/probability/2019-mclachlan.pdf)</sup> 在生物信息学中，DPMUnc 应用于免疫介导疾病全基因组关联分析汇总统计量，将自身免疫性疾病与自身炎症性疾病分开，并分离出成人起病关节炎等亚组。<sup>[14](https://journals.plos.org/ploscompbiol/article?id=10.1371%2Fjournal.pcbi.1012301)</sup> NCLUSION 是一种带有尖峰-平板先验的稀疏分层狄利克雷过程正态混合，通过变分期望最大化拟合；它同时对单细胞 RNA 测序数据进行聚类并选择标记基因，无需降维即可扩展到约 100 万个细胞。<sup>[16](https://pmc.ncbi.nlm.nih.gov/articles/PMC13030991/)</sup> 安德鲁·A·斯特恩（Andrew A. Stirn）和戴维·A·诺尔斯（David A. Knowles，2024）的 VampPrior 混合模型在深度潜变量模型内部拟合贝叶斯 GMM 先验；将其集成到 scVI 后，可改善单细胞 RNA 测序整合，并把细胞排布成具有相似生物学特征的簇。<sup>[17](https://doi.org/10.48550/arxiv.2402.04412)</sup>

## 局限与替代方法

对于分量协方差不受限制的 GMM，最大似然是无界的：EM 可能收敛到虚假解，其中退化分量方差极小，只包含少数位置接近的点。<sup>[6](https://www.nature.com/articles/s41598-023-44608-3)</sup><sup> • </sup><sup>[2](https://gwern.net/doc/statistics/probability/2019-mclachlan.pdf)</sup> EM 还容易陷入局部极大值、估计出奇异协方差矩阵，偶尔收敛到局部极小值；实践者会监控混合比例和分量广义方差，并从多个初始值启动 EM。<sup>[18](https://www.sciencedirect.com/science/article/abs/pii/S0167947318301245)</sup><sup> • </sup><sup>[2](https://gwern.net/doc/statistics/probability/2019-mclachlan.pdf)</sup> EM 的实践特点是全局收敛可靠、每次迭代成本低、存储经济，但在看似无害的应用中也可能表现出极其缓慢的收敛。<sup>[19](https://users.wpi.edu/~walker/Papers/mixtures-mle-em%2CSIREV_26%2C1984%2C195-239.pdf)</sup> 当每个分量的点太少时，协方差估计变得困难，除非对协方差进行正则化，否则算法可能发散到似然无穷的解。<sup>[8](https://scikit-learn.org/stable/modules/mixture)</sup> 模型误设是另一个问题：轻度误设会导致混合测度的收缩速率非常慢；如果真实分布并非恰好是有限混合，常用的簇数估计会随样本量发散。<sup>[20](https://www.pure.ed.ac.uk/ws/files/376994684/RSTA_BayesClust.pdf)</sup><sup> • </sup><sup>[21](https://ar5iv.labs.arxiv.org/html/2108.11753)</sup> 贝叶斯非参数方法并不能消除模型选择风险，因为狄利克雷过程高斯混合的后验未必收敛到真实簇数，而且 DPM 后验倾向于高估分量数。<sup>[22](https://turinglang.org/docs/versions/v0.42.9/tutorials/infinite-mixture-models/index.html)</sup><sup> • </sup><sup>[21](https://ar5iv.labs.arxiv.org/html/2108.11753)</sup>

与替代方法相比，k-means 是核为 \( N(\cdot \mid \mu_j, \sigma^2 I) \) 的高斯混合下 EM 的极限情形，它施加球形、等大小的簇，并且可以在不对 \( \sigma^2 \) 作假设的情况下严格推导为截断变分 EM；GMM 允许不同的椭球形状和大小。<sup>[20](https://www.pure.ed.ac.uk/ws/files/376994684/RSTA_BayesClust.pdf)</sup><sup> • </sup><sup>[4](https://www.sciencedirect.com/science/article/abs/pii/S0167865519301126)</sup> 在近期的收敛理论中，EM 在比谱聚类和[劳埃德算法](https://www.edgepedia.org/zh/lloyds-algorithm)（Lloyd's algorithm）更温和的分离条件下达到误聚类误差的极小极大最优速率，因为其 E 步使用软分配。<sup>[23](https://ar5iv.labs.arxiv.org/html/2509.08237)</sup> 基于密度的方法通过水平集范式进入，其中簇是密度上水平集 \( \{x: f(x) \geq c\} \) 的连通分量，沿循 DBSCAN 方法。<sup>[24](https://export.arxiv.org/pdf/2603.03188)</sup> 如 mclust 中的硬协方差约束，在特征依赖关系随簇变化时可能降低聚类效果，尤其是在簇分离度低时。<sup>[6](https://www.nature.com/articles/s41598-023-44608-3)</sup>

## References

1. [Finite Mixture Models, Model-Based Clustering, Classification, and Density Estimation Using mclust in R (book chapter)](https://mclust-org.github.io/mclust-book/chapters/02_mixture.html)
2. [Finite Mixture Models (McLachlan, Lee & Rathnayake, Annual Review of Statistics and Its Application, 2019)](https://gwern.net/doc/statistics/probability/2019-mclachlan.pdf)
3. [Gaussian Mixture Models in R (The R Journal, 2023)](https://journal.r-project.org/articles/RJ-2023-043/RJ-2023-043.pdf)
4. [k-means as a variational EM approximation of Gaussian mixture models (Pattern Recognition Letters)](https://www.sciencedirect.com/science/article/abs/pii/S0167865519301126)
5. [A. P. Dempster, N. M. Laird, D. B. Rubin (1977). Maximum Likelihood from Incomplete Data Via the EM Algorithm. Journal of the Royal Statistical Society Series B (Statistical Methodology).](https://doi.org/10.1111/j.2517-6161.1977.tb01600.x)
6. [Avoiding inferior clusterings with misspecified Gaussian mixture models (Scientific Reports, 2023)](https://www.nature.com/articles/s41598-023-44608-3)
7. [Finite mixture models and model-based clustering (Maitra, Iowa State)](https://dr.lib.iastate.edu/server/api/core/bitstreams/333bb46d-c759-4202-8f41-0e921271de53/content)
8. [2.1. Gaussian mixture models, scikit-learn documentation](https://scikit-learn.org/stable/modules/mixture)
9. [Mixture Models, Latent Variables and the EM Algorithm (Cosma Shalizi, CMU 402 lecture)](https://www.stat.cmu.edu/~cshalizi/402/lectures/19-mixtures/lecture-19.pdf)
10. [Mixture Models and the EM Algorithm (Christopher M. Bishop, Microsoft Research, CUED 2006 tutorial)](https://mlg.eng.cam.ac.uk/zoubin/tut06/Bishop-CUED-2006.pdf)
11. [John H. Wolfe (1965). A COMPUTER PROGRAM FOR THE MAXIMUM LIKELIHOOD ANALYSIS OF TYPES. .](https://doi.org/10.21236/ad0620026)
12. [Chris Fraley, Adrian E. Raftery (1999). MCLUST: Software for Model-Based Cluster Analysis. Journal of Classification.](https://doi.org/10.1007/s003579900058)
13. [The Infinite Gaussian Mixture Model (Rasmussen, NIPS 1999)](https://proceedings.neurips.cc/paper/1999/file/97d98119037c5b8a9663cb21fb8ebf47-Paper.pdf)
14. [Bayesian clustering with uncertain data (DPMUnc), PLOS Computational Biology](https://journals.plos.org/ploscompbiol/article?id=10.1371%2Fjournal.pcbi.1012301)
15. [Chelly, Irit and colleagues (2025). Consistent Amortized Clustering via Generative Flow Networks. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.2502.19337)
16. [Scalable nonparametric clustering with unified marker gene selection for single-cell RNA-seq data (NCLUSION)](https://pmc.ncbi.nlm.nih.gov/articles/PMC13030991/)
17. [Stirn, Andrew A., Knowles, David A. (2024). The VampPrior Mixture Model. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.2402.04412)
18. [Addressing overfitting and underfitting in Gaussian model-based clustering (Computational Statistics & Data Analysis)](https://www.sciencedirect.com/science/article/abs/pii/S0167947318301245)
19. [Mixture Densities, Maximum Likelihood and the EM Algorithm (Redner & Walker, SIAM Review, 1984)](https://users.wpi.edu/~walker/Papers/mixtures-mle-em%2CSIREV_26%2C1984%2C195-239.pdf)
20. [Bayesian Cluster Analysis (Philosophical Transactions of the Royal Society A)](https://www.pure.ed.ac.uk/ws/files/376994684/RSTA_BayesClust.pdf)
21. [A survey on Bayesian inference for Gaussian mixture model (arXiv 2108.11753)](https://ar5iv.labs.arxiv.org/html/2108.11753)
22. [Infinite Mixture Models, Turing.jl documentation](https://turinglang.org/docs/versions/v0.42.9/tutorials/infinite-mixture-models/index.html)
23. [Convergence and Optimality of the EM Algorithm Under Multi-Component Gaussian Mixture Models (arXiv 2509.08237, 2025)](https://ar5iv.labs.arxiv.org/html/2509.08237)
24. [Scalable Posterior Uncertainty for Flexible Density-Based Clustering (arXiv 2603.03188)](https://export.arxiv.org/pdf/2603.03188)

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

Topic: 技术与人造世界 › 计算技术与数字系统 › 人工智能与数据 › Machine learning and neural computation › Machine learning methods › Supervised, unsupervised, and semi-supervised learning › Clustering algorithms

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/probabilistic-clustering

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