Introduction: The Black-Box Distance Problem
Instance-based models, such as $k$-Nearest Neighbors ($k$-NN), are often considered "inherently interpretable" because they base predictions on specific training examples. However, a significant "black box" remains: the distance measure. In high-dimensional datasets, a standard Euclidean distance calculation might involve hundreds of features. While the model identifies which neighbors it chose, it cannot intuitively explain why those neighbors are considered similar. A human cannot easily grasp how a complex combination of dozens of feature differences results in a single distance value. This research introduces the Pairwise Distance Tree Framework (PDTF) to bridge this gap by creating a distance function that utilizes human-readable logic.
The Pairwise Distance Tree Framework (PDTF)
PDTF is a meta-learning approach that replaces opaque distance metrics with shallow, interpretable decision trees. The framework operates in three primary stages: training data preparation, tree training, and model integration.
- Pairwise Training Set Preparation: The training data is transformed into pairs $(x_i, x_j)$. The target variable for this meta-dataset is the actual distance (e.g., Euclidean) between them. The authors found that representing these pairs via pointwise differences ($\\beta$) significantly outperformed raw concatenation, suggesting that the magnitude of change between features is a more efficient signal for learning distance.
- Pairwise Distance Tree (PDT) Training: A shallow regression tree is trained to predict the distance between pairs. To maximize interpretability, the authors introduced Forced Split Constraints:
- PDT-F (Same-Feature): If the tree splits on a feature from the first instance, the next split must use the same feature from the second instance.
- PDT-T (Same-Threshold): A stricter version where both the feature and the numerical threshold must be identical for both instances.
- Integration: At inference time, the learned tree replaces the standard distance function. The $k$-NN model selects neighbors based on the tree's output.
Interpretable Similarity Logic
By transforming distance calculation into a set of logical rules, PDTF allows users to see exactly which features drive the similarity between data points. Unlike the continuous values of Euclidean distance, the PDTF approach discretizes distance into "buckets" of similarity, which aligns more closely with human cognition (e.g., "very similar" vs. "different").
Key Insights and Results
The framework was evaluated on 20 tabular benchmark datasets, ranging from 4 to 100 features. Key findings include:
- Predictive Performance: On small datasets, PDTF achieved an Accuracy/F1-score comparable to standard $k$-NN (e.g., ~0.81 F1-score for PDTF vs ~0.87 for Euclidean $k$-NN). While a gap exists in complex datasets, the trade-off is often acceptable for high-stakes domains.
- The 20% Plateau: Researchers discovered that the model's performance tended to plateau after using only about 20% of the available training pairs, mitigating the $O(n^2)$ computational challenge of pairwise learning.
- Efficiency: PDTF significantly outperformed existing Pairwise Difference Learning (PDL) methods in runtime, remaining computationally feasible on larger datasets where PDL failed to complete within 24 hours.
Conclusion and Future Work
PDTF provides a transparent alternative to traditional distance metrics, allowing for auditable similarity logic in instance-based learning. Future research aims to expand this modality to images and time series by leveraging interpretable features (like SIFT) and conducting human-in-the-loop evaluations to measure the practical utility of these tree-based explanations in real-world decision-making.
Summary updated