The Random Forest Kernel and other kernels for big data from random partitions

Alex Davies, Zoubin GhahramaniarXiv 2014

Introduction

In modern machine learning, a conceptual divide often exists between algorithmic, tree-based models like Random Forests and mathematically rigorous kernel methods such as Gaussian Processes (GPs) or Support Vector Machines (SVMs). While tree-based models excel at handling jagged, non-stationary data and scale well, kernel methods offer elegant uncertainty quantification and a continuous framework for inference.

Alex Davies and Zoubin Ghahramani bridge this gap by introducing Random Partition Kernels (RPKs). This framework leverages the logic of data partitioning—the fundamental operation in decision trees and clustering—to construct valid, scalable kernel functions. By treating the probability that two data points fall into the same partition as a measure of similarity, the authors create kernels that are inherently data-driven and computationally efficient.

The Random Partition Kernel Framework

The core innovation of this work is the definition of a kernel based on random partitions. Formally, if a space is partitioned into disjoint sets, the kernel similarity $k(x, x')$ is defined as the probability that $x$ and $x'$ belong to the same set. This approach yields several distinct advantages over traditional kernels like the Radial Basis Function (RBF).

The Random Forest Kernel (RFK)

The RFK is a "supervised kernel" constructed from a trained Random Forest. By observing which points share leaf nodes across multiple trees and at various depths, the model learns a task-specific similarity metric. Unlike unsupervised kernels, the RFK focuses on features that are predictive of the target variable $y$.

The Random Forest Kernel (RFK) provides a non-stationary predictive posterior, adapting its smoothness to the local density and complexity of the training data.

As shown in the predictive posterior plots, the RFK is naturally non-stationary. It can be "wiggly" in regions with complex data transitions and smooth in others, a property that traditional stationary kernels like RBF struggle to replicate without extensive hyperparameter tuning.

The Fast Cluster Kernel (FCK)

For scenarios requiring extreme scalability, the authors propose the Fast Cluster Kernel. This unsupervised variant uses a simplified clustering algorithm that subsamples dimensions and assigns points to random centers. This method achieves $O(N)$ scaling, making it suitable for datasets with millions of observations.

Key Insights: Data-Driven Structure

A significant benefit of partition-based kernels is their ability to automatically capture the underlying structure of the data without manual grid searches for hyperparameters like length-scales. Because the partitions are derived from the data itself (either through supervised tree growth or random clustering), the resulting kernel matrix is inherently tuned to the dataset's geometry.

A 2D visualization of data structure as captured by a partition-based kernel, highlighting its ability to identify complex clusters and branches.

Furthermore, these kernels result in block-diagonal matrices. The authors exploit this sparsity to perform matrix-vector multiplications—the primary bottleneck in GP and SVM training—extremely rapidly using iterative solvers and custom pre-conditioning techniques.

Performance and Scalability

The authors evaluated these kernels on various UCI regression datasets, including Boston housing prices and socio-economic data. The results demonstrated that RFK and FCK consistently outperformed standard Linear and RBF kernels in terms of test log-likelihood and Mean Squared Error (MSE).

The scalability results were particularly striking. While the RBF kernel's computational cost grows cubically ($O(N^3)$), the Fast Cluster Kernel maintained linear growth ($O(N)$), processing approximately 100,000 points per minute. This efficiency allows kernel methods to be applied to "big data" problems that were previously the exclusive domain of simpler linear models or deep learning.

Conclusion

The Random Forest Kernel and its counterparts represent a powerful synthesis of two major machine learning paradigms. By formalizing the connection between random partitions and kernel functions, Davies and Ghahramani provide a path toward kernel methods that are not only more accurate and adaptive but also capable of scaling to the massive datasets of the modern era. Future work may further enhance these methods through parallelization and more sophisticated supervised partitioning strategies.

Summary updated

BibTeX
@misc{davies2014random,
  author = {Alex Davies and Zoubin Ghahramani},
  title = {{The Random Forest Kernel and other kernels for big data from random partitions}},
  year = {2014},
  eprint = {1402.4293},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1402.4293},
}
Figure