SHAP (SHapley Additive exPlanations)
Also known as: SHAP Değerleri (Model Açıklanabilirlik), Shapley additive explanations, SHAP values, model explainability
SHAP is a model-explanation method, introduced by Scott Lundberg and Su-In Lee in 2017, that uses Shapley values from cooperative game theory to measure how much each feature contributes to an individual prediction, making the output of black-box machine-learning models interpretable. It supports both global explanations (overall feature importance) and local explanations (why one specific prediction came out the way it did).
Read the full method
Sign in with a free account to read this section.
Method map
The neighbourhood of related methods — select a node to explore.
When to use it
Use SHAP when you already have a trained black-box model (such as XGBoost, random forest, or deep learning) on cross-sectional or panel data with continuous, categorical, or binary features, and you need to explain its predictions rather than just report accuracy. It works at both the global level (which features matter overall) and the local level (why one case was predicted as it was). At least about 30 observations are needed; below that, SHAP values become unstable and a directly interpretable model such as a decision tree is safer.
Strengths & limitations
- Turns black-box models into interpretable ones by attributing each prediction to its features.
- Provides both global feature importance and local single-prediction explanations from one framework.
- Grounded in Shapley values from game theory, giving the attributions a principled, additive fairness basis.
- TreeSHAP gives fast, exact explanations for tree-based models such as random forest and XGBoost.
- KernelSHAP is model-agnostic, so the same approach applies to almost any trained model.
- Requires an already-trained ML model; SHAP explains a model, it does not build one.
- On small samples (n below about 30) SHAP values are unstable and feature contributions become unreliable.
- KernelSHAP is model-agnostic but computationally slow, especially on large datasets or many features.
- Attributions describe the model's behaviour, not the true causal effect of a feature in the world.
Frequently asked
Do I need to retrain my model to use SHAP?
No. SHAP explains a model you have already trained — such as XGBoost, a random forest, or a deep network — by attributing its existing predictions to the input features. It does not refit or change the model.
What is the difference between TreeSHAP and KernelSHAP?
TreeSHAP computes exact SHAP values quickly for tree-based models like random forest and XGBoost. KernelSHAP is model-agnostic and works for any model, but it is an approximation and is considerably slower, especially on large data.
Can SHAP explain a single prediction?
Yes. That is its local mode: for one case it shows how much each feature pushed the prediction above or below the baseline, with the contributions adding up exactly to the prediction. Aggregating these across the dataset gives global feature importance.
How much data do I need?
At least about 30 observations. Below that, SHAP values become unstable and feature contributions unreliable, so a directly interpretable model such as a decision tree is the safer choice.
Sources
- Lundberg, S.M. & Lee, S.-I. (2017). A Unified Approach to Interpreting Model Predictions. Advances in Neural Information Processing Systems, 30, 4766–4777. link ↗
How to cite this page
ScholarGate. (2026, June 1). SHAP (SHapley Additive exPlanations). ScholarGate. https://scholargate.app/en/machine-learning/shap-analysis
Which method?
Set this method beside its closest kin and read them side by side — the library lays the books on the table; the choice is yours.
- Decision TreeMachine learning↔ compare
- Gaussian Mixture ModelMachine learning↔ compare
- Logistic RegressionResearch Statistics↔ compare
- Random ForestMachine learning↔ compare
- XGBoostMachine learning↔ compare