Accurate Estimation of Feature Importance Faithfulness for Tree Models

Mateusz Gajewski, Adam Karczmarz, Mateusz Rapicki, Piotr Sankowski

Abstract

In this paper, we consider a perturbation-based metric of predictive faithfulness of feature rankings (or attributions) that we call PGI squared. When applied to decision tree-based regression models, the metric can be computed exactly and efficiently for arbitrary independent feature perturbation distributions. In particular, the computation does not involve Monte Carlo sampling that has been typically used for computing similar metrics and which is inherently prone to inaccuracies. As a second contribution, we proposed a procedure for constructing feature ranking based on PGI squared. Our results indicate the proposed ranking method is comparable to the widely recognized SHAP explainer, offering a viable alternative for assessing feature importance in tree-based models.

Introduction

Explainable AI (XAI) tools like SHAP or LIME are essential for interpreting complex model predictions. However, assessing the faithfulness of these explanations—how accurately they reflect the model's internal logic—remains a challenge. A standard metric for faithfulness is the Prediction Gap on Important feature perturbation (PGI), which measures the change in model prediction when "important" features are perturbed. Traditionally, calculating PGI requires computationally expensive and stochastic Monte Carlo (MC) sampling, leading to imprecise and inconsistent results. This work introduces an exact, efficient algorithm for computing a squared version of this metric ($PGI^2$) specifically for tree-based models.

Methodology

The authors propose three core innovations:

  1. The $PGI^2$ Metric: By replacing the absolute difference $|f(x') - f(x)|$ with a squared difference $(f(x') - f(x))^2$, the metric becomes mathematically tractable for exact expectation calculations. This change also emphasizes significant prediction shifts while marginalizing minor noise.
  2. Exact $O(n^2)$ Algorithm: For a tree ensemble with $n$ nodes, the expected $PGI^2$ can be computed exactly in quadratic time. The algorithm leverages the structure of decision trees, representing paths as interval intersections to transform probability estimation into a combinatorial problem.
  3. Greedy Feature Ordering: A new ranking procedure is introduced that greedily selects features to maximize $PGI^2$, providing a faithfulness-centric alternative to traditional explainers.

Experimental Results

The approach was evaluated on three regression datasets: Red Wine Quality, California Housing, and Parkinson Telemonitoring, using both single trees and larger ensembles (up to 40 trees).

Numerical Stability and Efficiency

A key finding is the inherent instability of sampling-based methods. Even with high iteration counts, Monte Carlo and Quasi-Monte Carlo (QMC) methods struggle to match the precision of the exact algorithm.

Convergence of Monte Carlo and Quasi Monte Carlo methods towards the exact PGI value.

As shown in the convergence plot, the difference between sampling estimates and the ground truth remains significant for thousands of iterations. The exact algorithm serves as a stable "ground truth" that eliminates this variance.

Comparative Performance

The exact method's precision is highlighted by the Normalized Mean Absolute Error (NMAE) observed in sampling methods. For smaller models, MC NMAE reached up to 0.132.

Comparison of Monte Carlo and Quasi Monte Carlo performance across various tree models and noise levels.

The results indicate that for large models, MC methods require up to 20,000 iterations to approach the accuracy of the exact algorithm. Furthermore, the greedy $PGI^2$ ranking proved competitive with SHAP, often outperforming it on faithfulness benchmarks.

Discussion and Limitations

While the $O(n^2)$ algorithm provides a significant leap in precision for tree-based models, it is currently limited to this architecture. Neural networks still require sampling-based approaches. Additionally, the algorithm assumes feature independence during perturbation; addressing feature correlations remains a priority for future research. Despite these constraints, the ability to exactly compute faithfulness metrics offers a new standard for evaluating XAI methods in tree ensembles.

Summary updated

BibTeX
@inproceedings{gajewski2025accurate,
  author = {Mateusz Gajewski and Adam Karczmarz and Mateusz Rapicki and Piotr Sankowski},
  title = {{Accurate Estimation of Feature Importance Faithfulness for Tree Models}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2025},
  url = {https://openreview.net/forum?id=fz9dt472kz},
}
Figure