AutoGMM: Automatic Gaussian Mixture Modeling in Python

Thomas L. Athey, Joshua T. Vogelstein

Introduction

Gaussian Mixture Models (GMMs) are a foundational tool for clustering, providing uncertainty-aware groupings and handling clusters of varying shapes. However, GMMs are notoriously sensitive to initialization, the choice of cluster count ($K$), and ill-conditioned covariance estimates. While R users have long benefited from the automated mclust package, the Python ecosystem has lacked a similarly robust, "out-of-the-box" solution. AutoGMM fills this gap by automating initialization, regularization, and model selection.

Methods

AutoGMM is a scikit-learn-compatible estimator that automates the GMM pipeline through three key stages:

  1. Strategic Initialization: It uses standard K-means, Ward-Euclidean, and a novel Ward-Mahalanobis agglomerative heuristic. The Mahalanobis variant uses a pooled-precision matrix to better handle anisotropic (stretched) clusters.
  2. Regularized Expectation-Maximization (EM): To prevent cluster collapse, AutoGMM stabilizes covariance updates by flooring eigenvalues at a safe threshold ($\varepsilon$), preserving the cluster's principal directions better than standard ridge shrinkage.
  3. Parallelized Model Selection: It evaluates various cluster counts and covariance constraints in parallel, selecting the optimal model via the Bayesian Information Criterion (BIC).
  4. Spectral Front-End: For non-convex data, an optional spectral embedding step maps complex manifolds into a latent space where they become separable by standard GMMs.
Comparison of clustering algorithms on synthetic datasets. AutoGMM (far right) achieves perfect ARI on non-convex shapes using its spectral front-end.

Key Results

The authors evaluated AutoGMM against R's mclust using synthetic and real-world datasets, including Drosophila connectome data and cancer fragmentomics.

High-Dimensional Robustness

A critical finding was AutoGMM's performance in high-dimensional spaces. In an anisotropic stress test, AutoGMM maintained near-perfect Adjusted Rand Index (ARI) up to 20 dimensions. In contrast, mclust's performance degraded significantly after 6 dimensions due to its reliance on Euclidean-based initialization.

ARI performance as a function of data dimensionality. AutoGMM maintains high accuracy up to 20 dimensions, while mclust fails beyond 6.

Real-World Performance

On the Drosophila connectome dataset, AutoGMM achieved an ARI of 0.76, significantly outperforming mclust's 0.62. Similar gains were observed in medical fragmentomics data. Furthermore, AutoGMM's Python-based parallelization ensures it remains faster than mclust as dimensionality and sample size scale.

Conclusion

AutoGMM brings automated, robust GMM clustering to the Python ecosystem. By combining strategic Mahalanobis-based initialization with eigenvalue-flooring regularization and an optional spectral front-end, it outperforms existing gold-standard tools on both high-dimensional and non-convex datasets. Future work will focus on improving the scalability of the $O(n^2)$ agglomerative seeding process.

Summary updated

BibTeX
@misc{athey2019autogmm,
  author = {Thomas L. Athey and Joshua T. Vogelstein},
  title = {{AutoGMM: Automatic Gaussian Mixture Modeling in Python}},
  year = {2019},
  eprint = {1909.02688},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1909.02688},
}
Figure