All lessons in Machine Learning Engineering: Reliable Predictive Models
Partial Dependence and SHAP Assumptions
Compare explanation questions and identify off-support and causal interpretation traps.
30 minutes · Members lesson · preview
What you will learn
- Compute a partial dependence value by hand from a small model and a set of rows, and state exactly what it averages over.
- Compute two-feature Shapley attributions for a single prediction and verify that they sum to the prediction minus the baseline.
- Diagnose when a partial dependence curve or SHAP display rests on off-support feature combinations or invites an unjustified causal reading.
Impurity and permutation importance answer one question: which columns does the fitted model lean on? Operations managers at the parcel carrier usually ask a different one: if dispatch load climbs from 40 to 80 parcels per van, how much does the predicted late-delivery probability move, and for this particular van leaving at 07:10, which inputs pushed its score up? Partial dependence and Shapley attributions are the standard tools for those two questions. Both are honest descriptions of a fitted function, and both are routinely misread as statements about the world. This lesson keeps the computations small enough to check by hand so that the assumptions are visible.
You only need the ideas from earlier core lessons: a model that maps features to a late-delivery probability, and the fact that permutation importance measures how much a held-out score drops when a column is shuffled. Nothing from other optional branches is assumed.