Introduction
Most traditional machine learning algorithms assume that data resides in a well-behaved Euclidean space, where every point is represented by a vector of features ($x \in \mathbb{R}^d$). However, in many real-world scenarios—such as crowdsourcing, taste testing, or subjective image similarity—we lack explicit coordinates or even a reliable distance metric. Instead, we only have access to an "oracle" (like a human evaluator) that can answer relative triplet comparisons: "Is item A more similar to B or C?"
The conventional approach to this problem is ordinal embedding: mapping these items into a low-dimensional Euclidean space that satisfies the triplet constraints, and then running a standard classifier. Unfortunately, this two-step process is computationally slow, introduces artificial distortions into the data, and requires guessing the "correct" number of dimensions for the embedding.
This paper introduces Comparison-Based Random Forests (CompRF), a novel algorithm that performs classification and regression using only these triplet comparisons. By skipping the embedding step entirely, CompRF is mathematically consistent, preserves the intrinsic structure of the metric space, and performs competitively with—and sometimes better than—traditional Random Forests.
The Comparison Tree Approach
The core innovation of CompRF is the Comparison Tree, which adapts the standard decision tree to work without coordinates.
The Split Mechanism: Instead of splitting on a specific feature threshold (e.g., "Is feature $x_i > 0.5$?"), a node in a comparison tree randomly selects two "pivot" points, $x_1$ and $x_2$. Any other point $x$ in the dataset is sent to the left child node if it is closer to $x_1$, and to the right child if it is closer to $x_2$. This effectively partitions the space using a generalized hyperplane based purely on relative distances.
Supervised vs. Unsupervised Pivot Selection: * Classification: The authors propose a "supervised" pivot selection strategy. By randomly picking two pivots that have different class labels, the tree is naturally guided to find boundaries that separate distinct classes. This mimics the "max-margin" concept of Support Vector Machines but operates efficiently within a tree structure. * Regression: Because continuous output values don't offer an obvious binary split for pivot selection, the algorithm falls back to an "unsupervised" approach, picking pivots entirely at random.
Like a standard Random Forest, CompRF aggregates many of these comparison trees, using majority voting for classification or averaging for regression to produce the final prediction. Furthermore, the authors provide a theoretical proof showing that a simplified version of this tree is statistically consistent—meaning its error converges to the optimal Bayes error as the dataset grows.
Experimental Validation
The authors evaluated CompRF across standard Euclidean datasets (MNIST, Gisette, UCIHAR), graph datasets (MUTAG, ENZYMES), and strictly comparison-only settings.
Key Results: * Competitive with CART: On Euclidean classification tasks, CompRF often matched or slightly outperformed standard CART-based Random Forests, despite lacking access to exact feature values. For instance, on the MNIST dataset, CompRF achieved a 2.50% error rate compared to CART's 2.90%. * Superior to Embeddings: In comparison-only settings (where algorithms are limited to a fixed budget of triplet queries), CompRF significantly outperformed the standard pipeline of Stochastic Triplet Embedding (TSTE) followed by KNN or CART. It proved to be both more accurate and orders of magnitude faster. * Graph Classification: On non-Euclidean graph datasets where distances were derived from graph kernels, CompRF outperformed Kernel SVMs, demonstrating its flexibility in spaces where data is structured as complex objects rather than simple vectors.
Limitations and Future Work
While CompRF excels in classification, it currently struggles with regression tasks (e.g., the Boston housing dataset) compared to CART. The authors attribute this performance gap to the "unsupervised" pivot selection used for continuous targets, suggesting that developing a supervised pivot selection method for regression is a critical next step.
Additionally, while the algorithm is computationally efficient compared to embedding methods, building a full forest still requires a high number of triplet queries. Optimizing the "budget" of comparisons to reduce query complexity remains an open area for future improvement.
Summary updated