Scalable Tree Ensemble Proximities in Python
Adrien Aumon, Guy Wolf, Kevin R. Moon, Jake S. Rhodes
TL;DR
Tree ensemble proximities enable supervised similarity measures but traditionally suffer from quadratic time and memory costs. The authors introduce Separable Weighted Leaf-Collision Proximities (WLCP) that admit an exact sparse factorization $P = QW^T$, reducing computation to leaf collisions and enabling near-linear time/space on standard CPUs. This framework generalizes several known proximities (e.g., RF, RF-GAP, GBT) and is implemented in Python using sparse linear algebra, dramatically improving scalability. Empirical results on large-scale datasets demonstrate substantial speedups and memory savings over prior approaches, validating the method's practicality for proximity-based analysis at scale.
Abstract
Tree ensemble methods such as Random Forests naturally induce supervised similarity measures through their decision tree structure, but existing implementations of proximities derived from tree ensembles typically suffer from quadratic time or memory complexity, limiting their scalability. In this work, we introduce a general framework for efficient proximity computation by defining a family of Separable Weighted Leaf-Collision Proximities. We show that any proximity measure in this family admits an exact sparse matrix factorization, restricting computation to leaf-level collisions and avoiding explicit pairwise comparisons. This formulation enables low-memory, scalable proximity computation using sparse linear algebra in Python. Empirical benchmarks demonstrate substantial runtime and memory improvements over traditional approaches, allowing tree ensemble proximities to scale efficiently to datasets with hundreds of thousands of samples on standard CPU hardware.
