The Distributional Uncertainty of the SHAP score in Explainable Machine Learning

Santiago Cifuentes, Leopoldo E. Bertossi, Nina Pardal, Sergio Abriola, Maria Vanina Martinez, Miguel Romero · DOI

Introduction

Explainable Artificial Intelligence (XAI) has become a cornerstone of trustworthy machine learning, with SHAP (SHapley Additive exPlanations) emerging as the industry standard for feature attribution. SHAP scores provide a mathematically grounded way to assign credit to individual features for a model's prediction. However, a critical yet often overlooked requirement for calculating SHAP scores is the "background" probability distribution of the data.

In practice, the true distribution of the population is rarely known. Instead, practitioners estimate it using a finite sample. If this sample is small, biased, or unrepresentative, the resulting SHAP scores can be highly misleading—potentially flipping a feature's perceived impact from positive to negative or entirely reordering the importance of features. This paper formalizes the concept of distributional uncertainty in SHAP, moving away from treating the score as a single point estimate and instead viewing it as a range of possibilities based on uncertain data distributions.

Theoretical Framework: The SHAP Polynomial

The authors propose a novel framework to reason about this uncertainty. For binary classifiers with independent features, they demonstrate that the SHAP score is not a constant, but a multilinear polynomial function of the feature probabilities.

By treating SHAP as a continuous function, the researchers can define Uncertainty Regions. These regions are modeled as "hyperrectangles" in a multi-dimensional space, where each dimension represents the possible range (a confidence interval) of a specific feature's probability. Within these regions, the goal is to determine the SHAP Interval: the minimum and maximum possible SHAP scores a feature could take given the uncertainty of the underlying distribution.

Computational Complexity

While the multilinear nature of the SHAP polynomial implies that the maximum and minimum values must occur at the "vertices" (the corners) of the hyperrectangle, finding exactly which corner yields these extrema is computationally daunting.

The paper provides rigorous proofs showing that finding the maximum SHAP score within an uncertainty region (REGION-MAX-SHAP) is NP-complete for common model types, including decision trees and decomposable Boolean circuits. Furthermore, determining whether a feature's impact is "ambiguous" (meaning it could be either positive or negative depending on the distribution) or whether one feature definitively dominates another is also computationally hard. This suggests that as models grow in complexity, calculating robust explanation bounds will require sophisticated approximation algorithms.

Empirical Evaluation: California Housing

To test the practical implications of this uncertainty, the authors conducted experiments using the California Housing dataset. They trained a decision tree classifier on binarized features to observe how SHAP scores fluctuated as the sample size (and thus the certainty of the distribution) changed.

Key Findings:

  1. Ranking Fragility: The experiments revealed that feature rankings are highly sensitive to distribution shifts. When uncertainty was high (using a small sample size of $p=0.4\%$), the SHAP intervals for the top-ranked features overlapped significantly. This means that for a single prediction, the "most important" feature could easily swap places with the second or third most important feature depending on the background sample used.
  2. Stability through Scale: As the sample size increased to $p=6.4\%$, the uncertainty regions shrank, and the SHAP intervals narrowed. Only at this higher level of certainty could the top feature (ocean_proximity) be statistically distinguished from the second-ranked feature (median_income).
  3. Robustness Metric: The authors suggest that the length of the SHAP interval serves as a valuable metric for explanation reliability. A narrow interval indicates a robust explanation, while a wide interval warns the user that the explanation is highly dependent on the specific background data provided.

Conclusion and Future Directions

This research marks a significant shift in XAI by treating SHAP scores as functions of the data distribution rather than static values. By proving the NP-completeness of bounding these scores, the authors highlight a fundamental challenge in providing robust explanations for complex models.

Future work is needed to expand this framework beyond binary features and to account for feature correlations (non-independent distributions). Additionally, the development of efficient heuristics will be essential for applying these robustness checks to high-dimensional datasets and more complex model architectures like deep neural networks. Ultimately, acknowledging distributional uncertainty is a vital step toward making machine learning explanations more reliable in real-world applications.

Summary updated

BibTeX
@inproceedings{cifuentes2024distributional,
  author = {Santiago Cifuentes and Leopoldo E. Bertossi and Nina Pardal and Sergio Abriola and Maria Vanina Martinez and Miguel Romero},
  title = {{The Distributional Uncertainty of the SHAP score in Explainable Machine Learning}},
  booktitle = {ECAI},
  year = {2024},
  doi = {10.3233/faia240586},
}
Figure