Every explainability technique answers one of two fundamentally different questions: "how does this model behave overall?" (global) or "why did the model make this one prediction?" (local) — picking the wrong scope for your actual question is a common, avoidable mistake.
The Core Distinction
| Global Explanation | Local Explanation | |
|---|---|---|
| Question answered | What does the model rely on overall, across all predictions? | Why did the model predict this specific outcome for this specific input? |
| Example question | "Which features matter most for churn prediction generally?" | "Why was this specific customer's churn risk predicted at 85%?" |
| Audience | Data scientists, model developers, general stakeholders | An individual affected by a specific decision, a support agent, an auditor of one case |
Which Techniques Serve Which Scope
| Technique | Global? | Local? |
|---|---|---|
| Permutation Importance | Yes | No |
| Random Forest's built-in feature_importances_ | Yes | No |
| LIME | No | Yes |
| SHAP | Yes (aggregated) | Yes (per instance) |
| Linear model coefficients | Yes | Partially — same coefficient applies everywhere, but its contribution to a specific prediction can still be computed |
A Worked Illustration of Why Scope Matters
# GLOBAL: "which features matter most for the model overall?"
from sklearn.inspection import permutation_importance
result = permutation_importance(model, X_val, y_val, n_repeats=10)
# -> one importance ranking, describing the model's OVERALL behavior
# LOCAL: "why did the model predict THIS customer will churn?"
import shap
explainer = shap.TreeExplainer(model)
shap_values = explainer.shap_values(X_val.iloc[[42]]) # just ONE row
# -> a feature-by-feature breakdown for THIS SPECIFIC prediction, which may
# look very different from the global importance ranking above
A feature can rank low in global importance (rarely influential overall) while still being the dominant factor for one specific, unusual prediction — global and local explanations genuinely can, and often do, tell different stories, and neither one is "wrong."
Choosing the Right Scope for a Real Situation
| Situation | Right Scope |
|---|---|
| Explaining model behavior to a technical team for debugging | Global |
| Explaining one loan denial to the specific applicant | Local |
| Deciding which features are safe to drop for a simpler model | Global |
| Auditing a single, unusual/flagged prediction | Local |
Practical Use Cases
- Correctly matching an explainability request (from a stakeholder, regulator, or teammate) to the right technique and scope
- Recognizing when a global summary alone won't satisfy a request that's actually asking about one specific case
Common Mistakes
- Answering "why did the model deny this specific application?" with a global feature importance chart — the global ranking may not reflect what actually drove this one case.
- Assuming a locally important feature for one prediction must also be globally important overall — the two scopes can disagree, and both can be simultaneously correct.
Interview Relevance
Q: "A stakeholder asks 'why did the model deny this customer's loan?' Which explainability approach do you use?" A local explanation (SHAP for that specific instance, or LIME) — this question is about one specific prediction, not the model's overall behavior, so a global feature importance ranking would answer a different question than the one actually being asked.
Practice Question
Explain a realistic scenario where a feature ranks low in global permutation importance but has a large SHAP value for one specific prediction.