Efficient hierarchical clustering for continuous data

Ricardo Henao, Joseph E. LucasarXiv 2012 · DOI

Abstract

We present a new sequential Monte Carlo (SMC) sampler for coalescent-based Bayesian hierarchical clustering. Our model is appropriate for modeling non-i.i.d. data and offers a substantial reduction of computational cost when compared to the original sampler without resorting to approximations. We also propose a quadratic complexity approximation that in practice shows almost no loss in performance compared to its counterpart. We show that as a byproduct of our formulation, we obtain a greedy algorithm that exhibits performance improvement over other greedy algorithms, particularly in small data sets. In order to exploit the correlation structure of the data, we describe how to incorporate Gaussian process priors in the model as a flexible way to model non-i.i.d. data. Results on artificial and real data show significant improvements over closely related approaches.

Introduction

Hierarchical clustering is a fundamental tool for discovering nested structures in complex datasets, ranging from biological phylogenies to linguistic patterns. While traditional agglomerative (bottom-up) clustering is computationally efficient, it lacks a principled probabilistic framework to account for uncertainty or to integrate with broader Bayesian models. Bayesian Hierarchical Clustering (BHC), which utilizes a "coalescent prior" from population genetics, addresses these issues but historically suffers from two major limitations: high computational cost (often $O(n^3)$) and the restrictive assumption that data points are independent and identically distributed (i.i.d.).

This paper introduces a new inference framework based on Sequential Monte Carlo (SMC) that reduces complexity to $O(n^2)$ while enabling the modeling of non-i.i.d. continuous data through Gaussian Process (GP) priors.

Methodology: Sequential Monte Carlo for Coalescent Models

The core contribution is a new SMC sampler designed for the Kingman coalescent model. The sampler builds the tree structure sequentially by proposing merges and estimating the posterior distribution of merging times.

The SMC Sampler

The proposed sampler processes data points $\mathbf{x}_1, \dots, \mathbf{x}_n$ starting at $t_1=0$. As time progresses, nodes are merged based on their similarity and the coalescent prior. This sequential process is illustrated in Figure 1, which shows how the state $\mathbf{z}$ evolves as nodes are merged at discrete time steps $t_k$.

Schematic of the Sequential Monte Carlo (SMC) sampler for hierarchical clustering, showing the sequential merging of nodes over time.

The authors derive two versions of the posterior for merging times:

  1. MPost1: An exact posterior derivation.
  2. MPost2: A fast approximation that achieves $O(n^2)$ complexity. This speedup is achieved by identifying that the most computationally expensive term—a modified Bessel function of the second kind—remains relatively constant across merging steps and can be simplified or cached without significant loss in accuracy.

Modeling Non-i.i.d. Data with GP Priors

To handle data with inherent temporal or spatial correlations (e.g., motion capture data), the framework incorporates Gaussian Process (GP) priors. By using Matérn or squared exponential covariance functions within the hierarchy, the model can distinguish between underlying structure and noise in continuous signals, a task where standard i.i.d. models typically fail.

MGreedy: A Principled Greedy Algorithm

As a byproduct of the SMC formulation, the authors propose MGreedy, a "corrected" greedy algorithm. Unlike standard heuristics that use simple distance metrics, MGreedy utilizes the properly normalized posterior of merging times, leading to superior tree reconstruction, particularly on smaller datasets.

Experimental Results

The model was evaluated against state-of-the-art methods across several domains, demonstrating improvements in both efficiency and accuracy.

Speed and Accuracy

On synthetic datasets (D1 and D2), MPost2 demonstrated a significant speed advantage. For the D2 dataset, MPost2 was approximately 23 times faster than the standard Post-Post approach. Crucially, this speedup did not come at the cost of accuracy; MPost2 maintained lower Mean Squared Error (MSE) and Mean Absolute Error (MAE) in estimating merging times compared to previous samplers.

Real-World Applications

  • USPS Handwritten Digits: In a classification task using a subset of 500 images, the model achieved an Area Under the Curve (AUC) of 0.89, outperforming standard average-linkage hierarchical clustering (0.85).
  • Motion Capture (MOCAP): The model was applied to 102 time series of 3D marker coordinates from a running person. It successfully reconstructed the human body's physical hierarchy (e.g., grouping leg markers together) from raw, highly correlated coordinate data.

Conclusion

The proposed SMC framework for Bayesian hierarchical clustering offers a scalable and flexible solution for continuous data. By reducing complexity to $O(n^2)$ and incorporating GP priors, it bridges the gap between efficient algorithmic clustering and rigorous probabilistic modeling. Future work includes extending the model to support non-binary tree structures and exploring stage-specific GP length scales to further enhance flexibility.

Summary updated

BibTeX
@misc{henao2012efficient,
  author = {Ricardo Henao and Joseph E. Lucas},
  title = {{Efficient hierarchical clustering for continuous data}},
  year = {2012},
  eprint = {1204.4708},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1204.4708},
}
Figure