Four chapters, four different answers to "why did the model say that." Applied to the exact same house, the exact same linear model, do they actually agree with each other — or is each one answering a subtly different question?
Same house from Chapter 6: size , age , distance , renovated. Switch lenses. Saliency reports the raw weight magnitudes — the same four numbers no matter which house you ask about. SHAP — short for SHapley Additive exPlanations — reports each feature's actual pull on this house's price, relative to a typical one. Counterfactual reports something else again: how much each feature would have to move to flip an approve/deny decision.
All three read the same four weights , but ask three different questions:
- — feature 's raw sensitivity: the magnitude of its weight, the same for every input.
- — the linear model's weight for feature .
- — feature 's actual contribution to this specific house's prediction.
- — this house's actual value for feature .
- — feature 's baseline (typical) value.
- — the counterfactual edit: how much each feature would need to change to flip the decision.
- — the model's prediction for input .
- — the full weight vector.
- Saliency: sensitivity in general
Saliency answers "how sensitive is the output to this feature, in general."
- SHAP: this instance's actual pull
SHAP answers "how much did this feature's actual value move this prediction away from typical."
- Counterfactual: the cheapest edit
Counterfactual answers "what's the cheapest edit that changes the decision."
- Different questions, not competing answers
None of them is wrong — they're just not the same question, and mixing them up is a real, common mistake.
Compare this house to the baseline house — a very different prediction, versus . Saliency's bars don't move at all: they never looked at either house's actual values, only the model's fixed weights. SHAP's bars do move, because SHAP's entire job is measuring how far this instance sits from typical.
This house predicts ; call anything below a threshold "not yet approved" for this exercise:
- Saliency says renovated matters most
for size, age, distance, renovated — renovated's raw sensitivity is the largest of the four, and that ranking would be identical for every house this model ever sees.
- SHAP ranks size highest instead
Size dominates here:
- Size contributes to the SHAP value, and this house's size is units above baseline
- Renovated contributes to the SHAP value, and this house's renovated status only differs by
- The counterfactual finds a different answer again
This house's prediction is , so below the threshold. The weight vector's squared norm is , giving a scale factor of . Each feature's delta is :
- Size:
- Age:
- Distance:
- Renovated:
That last number is a real problem: renovated is a feature, and isn't a valid value for it. The naive closed form doesn't know that "renovated" can't be anything other than or .
Age sits exactly at its baseline value in some hypothetical house. Which lens would show age contributing exactly zero in that case?
Every explanation technique in this part traces back to the same handful of ideas from earlier in the course: a derivative (saliency, Grad-CAM — short for Gradient-weighted Class Activation Mapping), a weighted local fit (LIME — short for Local Interpretable Model-agnostic Explanations), a fair game-theoretic split (Shapley, SHAP), and a gradient step toward a boundary (counterfactuals). None of them is "the" explanation — each answers a genuinely different question about the same model, and picking the right one means knowing which question you're actually asking. That's the real skill this part was building toward: not running an explainability library, but knowing what its output does and doesn't tell you. Explainability comes back for a second, deeper pass later in the course, once there are less transparent models — and a wider roster of architectures — actually worth auditing.