Skip to content
AI360Xpert
Paper Breakdowns
Paper breakdown

SHAP (SHapley Additive exPlanations)

Introduced SHAP, a unified framework for interpreting complex machine learning models by applying game theory to calculate the exact marginal contribution of each feature.

Paper: A Unified Approach to Interpreting Model Predictions

Authors: Scott M. Lundberg, Su-In Lee · 2017

Read the paper
SHAP treats a prediction as a cooperative game, where the 'payout' (the prediction) is fairly distributed among the 'players' (the input features).
SHAP treats a prediction as a cooperative game, where the 'payout' (the prediction) is fairly distributed among the 'players' (the input features).

The Problem

As machine learning models (like deep neural networks and gradient boosted trees) became more complex, they became 'black boxes'. You could get a highly accurate prediction, but you had no idea why the model made that prediction. In fields like healthcare, finance, and law, blindly trusting a black box is unacceptable. Previous feature importance methods were often inconsistent (sometimes assigning more importance to a feature that actually had less impact).

The Idea

The authors realized they could solve model explainability by borrowing a concept from cooperative game theory developed in the 1950s: Shapley Values.

Imagine a group of players collaborating to win a cash prize. Shapley values provide the only mathematically fair way to distribute that prize based on each player's marginal contribution. In ML, the 'prize' is the model's prediction, and the 'players' are the input features.

How It Works

To find the SHAP value for a single feature (e.g., 'Age'), you conceptually have to train the model on all possible combinations of features with and without 'Age'. You measure how much the prediction changes when 'Age' is introduced to a subset of features.

By averaging these marginal contributions across all possible subsets of features, you get a SHAP value. If the model predicts a house price is 100,000abovethebaselineaverage,theSHAPvalueswillsumexactlyto+100,000 above the baseline average, the SHAP values will sum exactly to +100,000, attributing specific dollar amounts to Square Footage, Location, Age, etc.

Because computing all subsets is exponentially expensive, the paper introduced fast approximation methods, like TreeSHAP (specifically optimized for tree-based models like XGBoost).

Why It Mattered

SHAP provided the first theoretically sound, mathematically consistent way to explain any machine learning model. It unified previous explainability methods (like LIME) under a single mathematical umbrella.

What Came After

SHAP became the gold standard for Explainable AI (XAI) in industry. The accompanying Python library became universally used by data scientists to crack open black-box models, generate feature dependence plots, and ensure models aren't making decisions based on biased or nonsensical logic.