Table of Contents
Fetching ...

Enhanced Local Explainability and Trust Scores with Random Forest Proximities

Joshua Rosaler, Dhruv Desai, Bhaskarjit Sarmah, Dimitrios Vamvourellis, Deran Onay, Dhagash Mehta, Stefano Pasquali

TL;DR

This work reframes random forest predictions as adaptive weighted sums of training targets using GAP proximities, enabling a local, instance-based explainability that complements feature-based methods like SHAP. By linking RF predictions to training-point proximities, the authors introduce proximity-weighted explanations and trust scores that quantify how likely a prediction is to be correct, including out-of-sample performance. The approach is demonstrated in RF regression and classification applied to US corporate bond price discovery, showing substantial RMSE improvement and interpretable, proximity-driven narratives for both accurate and inaccurate predictions. The methodology offers ex-ante confidence measures and visualization strategies, with potential to generalize to GBMs and other tree ensembles, thereby enhancing transparency and risk assessment in financial forecasting.

Abstract

We initiate a novel approach to explain the predictions and out of sample performance of random forest (RF) regression and classification models by exploiting the fact that any RF can be mathematically formulated as an adaptive weighted K nearest-neighbors model. Specifically, we employ a recent result that, for both regression and classification tasks, any RF prediction can be rewritten exactly as a weighted sum of the training targets, where the weights are RF proximities between the corresponding pairs of data points. We show that this linearity facilitates a local notion of explainability of RF predictions that generates attributions for any model prediction across observations in the training set, and thereby complements established feature-based methods like SHAP, which generate attributions for a model prediction across input features. We show how this proximity-based approach to explainability can be used in conjunction with SHAP to explain not just the model predictions, but also out-of-sample performance, in the sense that proximities furnish a novel means of assessing when a given model prediction is more or less likely to be correct. We demonstrate this approach in the modeling of US corporate bond prices and returns in both regression and classification cases.

Enhanced Local Explainability and Trust Scores with Random Forest Proximities

TL;DR

This work reframes random forest predictions as adaptive weighted sums of training targets using GAP proximities, enabling a local, instance-based explainability that complements feature-based methods like SHAP. By linking RF predictions to training-point proximities, the authors introduce proximity-weighted explanations and trust scores that quantify how likely a prediction is to be correct, including out-of-sample performance. The approach is demonstrated in RF regression and classification applied to US corporate bond price discovery, showing substantial RMSE improvement and interpretable, proximity-driven narratives for both accurate and inaccurate predictions. The methodology offers ex-ante confidence measures and visualization strategies, with potential to generalize to GBMs and other tree ensembles, thereby enhancing transparency and risk assessment in financial forecasting.

Abstract

We initiate a novel approach to explain the predictions and out of sample performance of random forest (RF) regression and classification models by exploiting the fact that any RF can be mathematically formulated as an adaptive weighted K nearest-neighbors model. Specifically, we employ a recent result that, for both regression and classification tasks, any RF prediction can be rewritten exactly as a weighted sum of the training targets, where the weights are RF proximities between the corresponding pairs of data points. We show that this linearity facilitates a local notion of explainability of RF predictions that generates attributions for any model prediction across observations in the training set, and thereby complements established feature-based methods like SHAP, which generate attributions for a model prediction across input features. We show how this proximity-based approach to explainability can be used in conjunction with SHAP to explain not just the model predictions, but also out-of-sample performance, in the sense that proximities furnish a novel means of assessing when a given model prediction is more or less likely to be correct. We demonstrate this approach in the modeling of US corporate bond prices and returns in both regression and classification cases.
Paper Structure (18 sections, 7 equations, 15 figures)

This paper contains 18 sections, 7 equations, 15 figures.

Figures (15)

  • Figure 1: Plotting cumulative GAP weight as a function of the number of nearest neighbors. On average, only 1/15 of the the total training set contributes to the RF model's prediction.
  • Figure 2: Mean absolute test error as a function of the weighted MAE of the test point's nearest neighbors. The monotonic relationship indicates that higher proximity-weighted training error can help to explain why the model prediction was more likely to be off.
  • Figure 3: Example, where out-of-sample model error is high, as predicted by the large value for the proximity-weighted train, set MAE.
  • Figure 4: Scatterplot of top 2 SHAP features at the test point (red). Green points are training points in the same decile bin of the predicted label as the test point. In orange are the training points with the largest proximity relative to the test point. The points most heavily influencing the model prediction are on the periphery of both the decile and the full training set, where data is sparse.
  • Figure 5: Marginal plots showing separately the proximity-weighted vs unweighted train set feature distribution for each of the top 2 SHAP features (with the most important feature on the left). The proximity-weighted distribution of the most important feature (dark blue), is concentrated in the tails of the training distribution (faded blue).
  • ...and 10 more figures