Random forests are among the most reliable off-the-shelf learners, but every split they make asks a coordinate question such as "is feature 7 below 3.2?" Many modern inputs have no coordinates. Examples are strings, graphs, probability distributions, and covariance matrices. For these we know only how far apart two objects are. This proposal builds trees whose splits ask a question that needs only distances: "is this object closer to reference object $a$ or to reference object $b$?" The reference objects, called pivots, are drawn at random from the training points in the node. The central aim is to prove that a forest of such trees converges to the best possible classifier (the Bayes rule) on any separable metric space and for every data distribution. The design must also keep the label-guided split choice that makes Breiman forests work in practice.
The key mechanism is a split rule that mixes two kinds of split. At each node, with a small probability $p_n$ the tree makes a purely geometric split: two pivots are drawn and the split is taken without looking at labels. Otherwise it picks, among $m$ random pivot pairs, the split that most reduces impurity, which is the analogue of Breiman's feature-subsampling parameter mtry. The geometric splits make cells shrink around every point, and that shrinking is what the consistency proof needs. The label-guided splits make the forest adaptive, so it ignores directions in which the metric varies but the label does not. We claim that this mixture achieves both properties, whereas neither kind of split achieves both alone.
What exists and what is missing
The theory of consistency on metric spaces is mature but uses no trees. Universal Bayes consistency in metric spaces shows that a universally consistent rule exists exactly when the space is "essentially separable," meaning every probability measure lives on a countably dense subset. Its constructive proof, OptiNet, is a multiscale nearest-neighbor compression scheme that costs $O(n^2)$ time. Universal consistency and rates of convergence of multiclass prototype algorithms in metric spaces simplifies this with Proto-NN, a majority vote over cells formed by the nearest data-drawn "nucleus." That paper leaves its finite-sample rates open. A Bayes consistent 1-NN classifier gets consistency by pruning conflicting pairs through a vertex cover, which costs $O(n^{4.376})$. Rates of Convergence for Nearest Neighbor Classification gives $k$-NN rates in metric spaces under a smoothness condition measured in probability mass. Fast, smooth and adaptive regression in metric spaces achieves rates that adapt to the space's intrinsic "doubling" dimension $d$, meaning each ball can be covered by $2^d$ half-radius balls, using a deterministic cover tree. That method carries a $2^{8d}$ constant. These papers motivate the proposal: they establish what is achievable, and they show that every consistent metric learner so far is a label-blind partition or a nearest-neighbor rule with no ensemble.
The theory of randomized splitting, on the other hand, assumes coordinates throughout. Universal Consistency of Decision Trees in High Dimensions proves that CART and Breiman forests are consistent even when mtry is a vanishing fraction of $p$. Its proof relies on axis-aligned cuts and additive structure. Oblique variants such as Random Projection Forests (sparse random linear combinations, whose consistency is stated as open) and Binary Space Partitioning Forest (random angled cuts on coordinate pairs) need vector algebra. Mondrian Forests: Efficient Online Random Forests uses label-independent random cuts, which are convenient for theory. Its authors report that it falls behind Breiman forests on the noisy dna dataset. That result constrains the design: purely geometric randomization is not enough.
The closest bridge, Random Forest Weighted Local Fréchet Regression with Random Objects, handles metric-space responses. Its predictors stay in $\mathbb{R}^p$ and its splits stay coordinate-based. We work the other way around: the inputs are metric objects, and the splits use only $\rho$.
Randomized pivot splits are an obvious heuristic, and similar ones have surely been tried outside this file. We are not proposing the split itself as the contribution. The contribution is the consistency theory for label-guided randomized metric trees and the geometric-mixing ingredient that makes that theory possible.
Core Claim
Let $(\mathcal{X},\rho)$ be a separable metric space. A pivot split at a node with training points $S$ draws $a,b \in S$ and sends $x$ left when $\rho(x,a) - \rho(x,b) \le t$, where the threshold $t$ is chosen by impurity reduction or set to zero in geometric splits. We call trees built this way honest when half of the node's data chooses the splits and the other half estimates the leaf votes. Suppose each node makes a geometric split with probability $p_n$, grows until leaves hold $k_n$ estimation points, and satisfies
$$ p_n \cdot \mathrm{depth}_n \to \infty, \qquad k_n \to \infty, \qquad k_n/n \to 0 . $$
Here $p_n \cdot \mathrm{depth}_n$ is the expected number of geometric splits along a root-to-leaf path. The first condition ensures that this number diverges; the second and third are the usual leaf-size conditions. Under these conditions we claim that the tree's and the forest's majority votes are strongly universally consistent. We aim to prove this first on Polish spaces (complete and separable), where measures are tight, and then on all separable spaces.
The proof strategy follows the classical partitioning theorem: a partition rule is consistent if the cell containing $X$ shrinks in diameter in probability and holds a growing number of points. The new step is a separation lemma. Take points $x$ and $y$ in the support of the distribution with $\rho(x,y) > \varepsilon$. If pivot $a$ lands within $\varepsilon/3$ of $x$ and pivot $b$ lands within $\varepsilon/3$ of $y$, the triangle inequality forces $x$ and $y$ to opposite sides of a zero-threshold split. Pivots drawn from the node's own data hit such balls with positive probability. Tightness then turns this into uniform shrinkage over a compact set of near-full measure.
Label-guided splits cannot undo this shrinkage because cells only get finer. They therefore add adaptivity at no cost to consistency. The forest inherits consistency from its trees, and mtry-style subsampling of $m$ pivot pairs plays the role it plays in the Klusowski–Tian result.
A second, harder target concerns doubling spaces. There we aim for a rate of the form $n^{-\alpha(\beta+1)/(2\alpha+1)}$, the Chaudhuri–Dasgupta exponent, adjusted for the depth lost to geometric splits. We also ask whether averaging over randomized trees improves the $2^{O(d)}$ constant compared with a single cover tree.
Research Program
The theoretical work has three pieces. The first is the separation lemma and the consistency theorem on Polish spaces. The second is the extension to general separable spaces, or else a counterexample showing where honest pivot trees fail. The third is a negative result showing that $p_n = 0$ can be inconsistent. We will construct a metric analogue of sparse parity where no single pivot split reduces impurity, so a purely greedy tree never splits the informative region.
The algorithmic work is an implementation that treats the metric as a black box. It will sample pivots from the node, cost $O(m \cdot |S|)$ distance evaluations per node, and give a forest training cost of roughly $O(B \cdot m \cdot n \log n)$ distance calls. This stands against $O(n^2)$ for OptiNet. The implementation will include out-of-bag tuning of $m$, $p$, and leaf size, following Hyperparameters and Tuning Strategies for Random Forest.
Baselines
The naive reference point is $k$-NN with $k$ chosen by cross-validation, the rule analyzed by Chaudhuri and Dasgupta. It uses exactly the same distance oracle and is the method a practitioner would reach for first. The consistent metric competitors are Proto-NN and OptiNet. SRM-1-NN joins them only at the small sample sizes its $O(n^{4.376})$ cost allows, such as the 2D spiral.
The strongest practical competitor is a landmark embedding. It draws $L$ random training points as landmarks, represents each object by its $L$ distances to them, and runs Breiman forests tuned with tuneRanger. It uses the same distance oracle and the same learner family, so any gap between it and our method isolates the value of local, per-node pivots and of geometric mixing.
On Euclidean data we also report Breiman forests and SPORF operating on raw coordinates. This measures the price of seeing only distances. All methods get the same train/test splits, the same number of distance evaluations where applicable, and the same tuning budget of SMBO trials on out-of-bag or validation error.
The ablations are pure label-guided pivot trees ($p=0$), purely geometric pivot trees ($p=1$, a Mondrian-like analogue), and global rather than node-local pivots. For the strongest tuned-forest baseline, the only number in the file is a relative one. Hyperparameters and Tuning Strategies for Random Forest reports that tuneRanger improves on defaults by "0.014 in the Mean Misclassification Error (MMCE)" and "0.007 in the Area Under the Curve (AUC)" averaged over 39 OpenML100 datasets. No absolute per-dataset MMCE was found on Lacuna. No reported result was found on Lacuna for any existing method with metric-space predictors on the Fréchet-regression datasets.
Beating the baselines means two things. The pivot forest must match or improve on the tuned landmark forest and on $k$-NN in mean misclassification across the metric-native tasks. It must also stay within the tuneRanger improvement margin (0.014 MMCE) of coordinate-based Breiman forests on OpenML100, while using only distances.
Why not just…?
Why not just embed with distances to landmarks and run an ordinary random forest? This is the real threat to predictive accuracy, and we do not claim it will lose. We do know it has two weaknesses. Its landmarks are global, so a region far from all landmarks is split coarsely. And its consistency needs the number of landmarks to grow in a way no cited result controls, since Klusowski and Tian's proof assumes additive coordinate structure, which distance features do not have. The global-versus-local pivot ablation and the head-to-head comparison settle the accuracy question. If the embedding matches our method, we will extend the theorem to cover landmark forests with growing $L$ as a special case. The theoretical contribution then stands regardless of which implementation wins.
Why not just use Proto-NN or OptiNet, which are already universally consistent? They are label-blind partitions. The dna result in Mondrian Forests shows how label-blind partitioning suffers when much of the variation is irrelevant to the label. OptiNet also costs $O(n^2)$. The noisy-metric experiment below tests directly whether label guidance pays off.
Why not just use purely random geometric splits, which are easier to analyze? This is the $p=1$ ablation. We expect it to inherit Mondrian's weakness with irrelevant variation. The mixture should keep its guarantee while matching $p=0$ in accuracy.
Proposed Experiments
The decisive synthetic check has two parts. In the first, we build a metric version of the sparse-parity and XOR constructions from Random Projection Forests and add the 2D spiral from the SRM-1-NN paper. We then plot excess error against $n$ on a log scale up to around $10^5$. The prediction is that $p=0$ plateaus above the Bayes risk while $p>0$ keeps decreasing. A plateau for $p>0$ would falsify the core claim.
In the second, we build a noisy metric. It is the sum of a distance on a few informative components and a distance on many irrelevant ones, modeled on Friedman's function with noise dimensions. The prediction is that the mixture beats $p=1$ and Proto-NN while matching $p=0$.
On metric-native data, we reuse objects from Random Forest Weighted Local Fréchet Regression with Random Objects as predictors rather than responses. These are simulated Wasserstein-distributed, positive-definite-matrix, and spherical objects, human mortality histograms under the Wasserstein distance, and New York taxi adjacency matrices under an affine-invariant metric. Labels come from the metadata that accompanies them, such as region or weekday.
On OpenML100 and dna, we run the forest with the Euclidean metric. This measures the price of coordinate-freeness against coordinate-based Breiman forests, and it tests whether the mixture fixes Mondrian's dna gap.
We also report wall-clock time and the number of distance calls against OptiNet. Finally, we measure pairwise tree correlation, checking that pivot subsampling decorrelates trees the way mtry does.
References
- Universal Bayes Consistency in Metric Spaces
- Universal consistency and rates of convergence of multiclass prototype algorithms in metric spaces
- A Bayes consistent 1-NN classifier
- Rates of Convergence for Nearest Neighbor Classification
- Fast, smooth and adaptive regression in metric spaces
- Universal Consistency of Decision Trees in High Dimensions
- Random Projection Forests
- Binary Space Partitioning Forest
- Mondrian Forests: Efficient Online Random Forests
- Random Forest Weighted Local Fréchet Regression with Random Objects
- Hyperparameters and tuning strategies for random forest