Which properties of a feature attribution can you verify, and which depend on choices the attribution never shows?
Notebook capstone 4~30 minadvanced Two written-out models with known weights
The story
A credit team wants to show each applicant "why" a model scored them as it did, with one bar per feature. Before the bars reach anyone, the reviewer asks four questions. Do the attributions add up to the prediction they explain? Would they change if someone chose a different reference point, the baseline? Would they change if the model's weights were scrambled? And what do they not say?
You'll answer with two small, fully written-out models, so every number can be checked exactly: a three-feature model with an interaction, explained by exact Shapley values over every coalition, and a small network explained by Integrated Gradients along a straight path. In CodeSplash, the same methods run on saved models with SHAP values and Gradient attributions in Analyze.
Data: Two written-out models with known weights · Simulated. Defined in the notebooks (ML reference, explanation-audit workflow).
Enumerate every coalition to get exact Shapley values for one prediction, check that they add up to the change from the baseline, then compute them again against a different baseline.
Do the attributions add up, and how much do they depend on the baseline?
Notebook exercise: Exact Shapley values and the baseline. Compute exact Shapley values for a three-feature model by enumerating coalitions, check that they add up, and see them change with the baseline. 3 checks in Python or R.
Stage 2 · notebooks · ~15 min
Integrated Gradients and the randomization check
Compute Integrated Gradients for a small network, measure the completeness gap, and compare the attributions with those of the same network with scrambled weights.
Is the completeness gap small, and do the attributions change when the weights are scrambled?
Notebook exercise: Integrated Gradients and a randomization check. Compute Integrated Gradients for a small network, check completeness, and run the sanity check that an explanation must change when the weights are scrambled. 3 checks in Python or R.
Hints
An attribution explains the change from a baseline; write the baseline next to every chart.
Completeness is a property of the method, not evidence that the explanation is right.
An explanation that doesn't change when the model's weights are scrambled isn't explaining the model.
appendix
Explanation audit appendix
Write the audit appendix the reviewer asked for: the checks you ran, what each showed, the baseline you recommend reporting, and what the attributions don't claim.
Additivity
Baseline sensitivity
Randomization check
What the bars don't say
Rubric
Criterion
Points
Shows the attributions add up to the change from the baseline (completeness).
2
Shows that changing the baseline changes the attributions and says which to report.
2
Reports the randomization check and what a failure would mean.
2
States that attributions describe the model near this point, not causes in the world.
2
Model answer
Show the model answer
Additivity. Exact Shapley values for the three-feature model add up to the change from the baseline to the explained point, to rounding. Integrated Gradients with 200 midpoints leaves a completeness gap well under a thousandth. Both properties hold by construction, so passing them checks the code, not the explanation.
Baseline sensitivity. Against the training average instead of zeros, the same prediction's Shapley values change: one feature's share halves and the interaction moves weight to another. The baseline is part of the explanation, so the report should name it, and the training average is the easier one to explain to an applicant.
Randomization check. Integrated Gradients for the network with scrambled weights rank the features differently from the real network, so the method passes: its output depends on the weights. A method whose bars barely moved would have failed.
What the bars don't say. They describe how this model responds near this applicant, relative to the baseline. They don't say what would change the outcome in the world, and they don't make the model fair or right.