Abstract
Kernel methods are ubiquitous tools in machine learning. However, there is often little reason for the common practice of selecting a kernel a priori. Even if a universal approximating kernel is selected, the quality of the finite sample estimator may be greatly affected by the choice of kernel. Furthermore, when directly applying kernel methods, one typically needs to compute a $N \times N$ Gram matrix of pairwise kernel evaluations to work with a dataset of $N$ instances. The computation of this Gram matrix precludes the direct application of kernel methods on large datasets, and makes kernel learning especially difficult. In this paper we introduce Bayesian nonparmetric kernel-learning (BaNK), a generic, data-driven framework for scalable learning of kernels. BaNK places a nonparametric prior on the spectral distribution of random frequencies allowing it to both learn kernels and scale to large datasets. We show that this framework can be used for large scale regression and classification tasks. Furthermore, we show that BaNK outperforms several other scalable approaches for kernel learning on a variety of real world datasets.
Introduction
Kernel methods, such as Support Vector Machines and Gaussian Processes, are powerful tools that allow linear models to operate in high-dimensional feature spaces. However, they face two primary challenges: the selection problem and the scalability problem. Choosing the right kernel is often a matter of trial and error, and traditional methods require computing an $N \times N$ Gram matrix, leading to $O(N^3)$ complexity that is prohibitive for large datasets.
Bayesian Nonparametric Kernel-Learning (BaNK) is a framework that automates kernel selection. Instead of manually picking a kernel, BaNK uses Bayesian nonparametrics to learn the optimal kernel directly from the data while maintaining the scalability needed for massive datasets.
Methodology
BaNK combines Bochner’s Theorem with Dirichlet Process Mixture Models (DPMM) to solve the dual hurdles of selection and scale.
Kernels as Distributions
Bochner’s Theorem states that every stationary (shift-invariant) kernel has a corresponding spectral density—a probability distribution of frequencies. By learning this distribution, the model effectively learns the kernel. BaNK treats the spectral density as a latent variable and places a Dirichlet Process prior over a mixture of Gaussians. This allows the model to automatically determine the necessary complexity (number of components) for the spectral density based on the data.
Scalability and Inference
To address scalability, BaNK utilizes Random Fourier Features to map data into a lower-dimensional primal space, turning the $O(N^3)$ problem into one that scales linearly with $N$. Inference is performed via a specialized Markov Chain Monte Carlo (MCMC) sampling scheme, using Gibbs sampling for mixture assignments and a Metropolis-Hastings step for random frequencies.
Experimental Evaluation
The authors evaluated BaNK on a wide array of standard benchmarks from the UCI Machine Learning Repository, including regression tasks (e.g., twitter with >580,000 instances) and classification tasks (e.g., skin with >245,000 instances).
Key Results
- Superior Accuracy: BaNK achieved the lowest Mean Squared Error (MSE) on 6 out of 8 regression datasets and was a top performer in all classification tasks.
- Kernel Recovery: On synthetic data, BaNK successfully recovered complex, multi-modal kernels that human experts would likely never have hand-designed.
- Empirical Scalability: Runtime tests confirmed that the model scales linearly with the number of data points ($N$), making it feasible for datasets where traditional kernel methods fail.
Conclusion
BaNK provides a robust, data-driven alternative to manual kernel selection. While currently limited to stationary kernels, its ability to approximate any stationary kernel through an infinite mixture of Gaussians represents a significant step forward in automated machine learning. Future work may extend this approach to non-stationary kernels or integrate it into deep learning architectures.
Summary updated