liveBook · Manning

SHAP

As explained in Machine Learning System Design

A feature-attribution technique based on Shapley values that assigns contributions of input features to a model prediction.

SHAP (SHapley Additive exPlanations) is a model-agnostic feature-attribution technique. It estimates how much each feature contributes to a specific prediction by averaging its contribution across all possible feature combinations. This makes SHAP useful for explaining individual decisions rather than only describing overall model behavior. section 11.2.1

Use SHAP to:

  • Explain why a particular prediction received its outcome by identifying the features that contributed to it. section 11.2.1
  • Analyze deep-learning inputs at different levels, including pixels, tokens, characters, frequencies, and more abstract patterns. section 11.2.3
  • Compare SHAP with permutation importance, LIME, and built-in measures such as linear coefficients or tree split counts. section 11.2.1 section 11.5.1

Retail feature selection

For a Supermegaretail demand model, SHAP can estimate how features such as promotion calendars, discounts, store traffic, weather, and prior sales contribute to the model’s outcome. The team uses those contributions alongside LIME, shuffle importance, and built-in measures; features contributing little may be dropped. section 11.5.1

Figure 11.3 A taxonomy of model explanation methods
figure

Use the taxonomy to locate SHAP among model-agnostic explanation methods and distinguish local explanations from whole-model interpretation. section 11.2.1

How Machine Learning System Design covers it

How deep it goes
Defines contribution estimation by averaging across feature combinations, but does not derive the underlying Shapley mathematics.
Examples
Uses retail demand features, deep-learning pixels and tokens, and comparisons with LIME and shuffle importance.
What it assumes
Assumes a predictive model, input features, and basic feature-importance concepts; treats the model as a black box.
What you can do after
Evaluate/understand which input features contribute to predictions and inform feature-removal decisions.
How it connects
Connects model-agnostic explanation with permutation feature importance, LIME, anchor explanations, saliency maps, and built-in importance measures.

Also explained in

Compare how 5 books explain SHAP →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Machine Learning System Design. The section links point to the parts of the book it draws on.