Explainable Gradient Boosting

Machine Learning
Introduced by
Lundberg, S. M. & Lee, S.-I. (TreeSHAP for tree ensembles)
Year
2017–2020
Type
Ensemble + explainability layer
Family
Machine learning

What does it do?

Explainable Gradient Boosting pairs a gradient boosting ensemble with post-hoc explanation tools, principally SHAP (SHapley Additive exPlanations), so that a fitted model yields both global feature rankings and per-prediction attributions.

The predictive model is the ensemble itself; the explanation is computed on top of it. The term therefore names a workflow built from existing components rather than a single published algorithm.

The intuition behind the method

Gradient boosting builds many sequential trees that together form a strong but opaque predictor. Explanation layers, particularly TreeSHAP, use Shapley values from cooperative game theory to distribute each prediction across its input features, giving every feature a signed contribution score for that prediction. The result can be inspected at two levels: globally (which features matter most on average?) and locally (why did the model give this specific observation a high score?). This dual view helps analysts judge whether the model is using plausible signals, and helps them detect when it is relying on spurious ones.

History

Gradient boosting machines build an ensemble of trees that are fitted sequentially, each one correcting the errors of the current model. Widely used open-source implementations include XGBoost, LightGBM, and CatBoost. The interpretability component was introduced by Lundberg and Lee (2017), who proposed SHAP based on Shapley values. Lundberg et al. (2020) introduced TreeSHAP, an exact polynomial-time algorithm for tree ensembles, and presented workflows that move from local explanations to global understanding. The combination of boosted trees with these tools is now a common applied practice, but it is not a single originally published method.

When to use it

Use Explainable Gradient Boosting when the data are tabular, a gradient boosting model is a reasonable predictive choice, and individual predictions or feature-level effects must be inspected, documented, or justified, for example in credit scoring, clinical decision support, fraud detection, or other regulated settings. It is also suitable for model debugging, such as checking whether a model relies on identifier columns or protected attributes. Do not choose it when a simpler inherently interpretable model suffices: for small or approximately linear problems, a logistic regression or decision tree is easier to validate and to explain directly. Do not rely on SHAP attributions as the main evidence when predictors are strongly correlated, and do not use the post-hoc layer where a regulator requires an intrinsically transparent model.

Limitations and considerations

  • Post-hoc SHAP attributions can be unstable in their allocation when features are strongly correlated, because the shared predictive signal may be divided among the correlated predictors in ways that are hard to interpret individually. The allocation also depends on the feature-perturbation setting and background data used by TreeSHAP, so these choices should be reported with the results.
  • Explainability adds computational and workflow overhead: generating SHAP values for large datasets and many explanations takes time and storage, even with TreeSHAP's efficiency.
  • SHAP attributions describe the fitted model's learned associations, not ground-truth causal relationships; a model trained on confounded data will produce attributions that reflect the confounding.
  • An explanation layer does not correct a poorly specified or biased model; SHAP values computed from biased training data faithfully reflect that bias.
  • SHAP values are expressed in the model's raw output units. For a binary classifier trained with a logistic loss they are on the log-odds scale, not the probability scale, so an attribution is not by itself a change in predicted probability.
  • Some regulatory settings require intrinsically transparent models, in which case a post-hoc explanation of an opaque ensemble may not satisfy the requirement.

Source conditions do not replace independent scientific review or validation by an analysis engine.

Strengths

  • Pairs a strong tabular predictor with explanations grounded in Shapley values from cooperative game theory, so each prediction's attribution has a defined axiomatic basis.
  • TreeSHAP computes exact Shapley values in polynomial time for tree ensembles, which keeps attribution practical on larger datasets with many features.
  • Provides both global feature rankings and per-prediction attributions, serving different audiences: model developers, domain experts, and individual decision reviewers.
  • Mean absolute SHAP importance is not based on split statistics, so it does not share the cardinality bias of impurity-based importance.
  • The explanation layer can be applied to the major gradient boosting implementations named above, so the predictive model does not need to be replaced to add explanations.
  • Supports auditing workflows in regulated domains by producing per-case records that can be documented alongside performance metrics.

Applications

  • Credit risk scoring with feature-level regulatory compliance documentation.
  • Clinical decision support where clinicians need per-patient explanations of risk predictions.
  • Fraud detection with auditable reasons for flagging specific transactions.
  • Predictive maintenance with feature attribution to diagnose which sensor signals drive failure predictions.
  • Social science research where researchers need both predictive accuracy and interpretable variable-level findings.
  • Model debugging and bias auditing to identify spurious or protected-attribute-driven predictions.

How it works

How it works

1

A gradient boosting model (e.g., XGBoost, LightGBM, CatBoost, or scikit-learn's GradientBoostingClassifier) is fitted on the training data using standard hyperparameter tuning and cross-validation. The fitted ensemble is then passed to the explanation pipeline. The model itself is unchanged: explainability is a post-hoc layer unless an intrinsically interpretable variant (e.g., EBM / GA2M) is used instead.

2

TreeSHAP computes exact Shapley values for every feature in every prediction in polynomial time by exploiting the tree structure, rather than enumerating all feature subsets. Each SHAP value phi_i is the marginal contribution of feature i to that prediction, averaged over feature coalitions as in the formula above. The attributions are expressed in the model's raw output units (for example log-odds for a binary classifier with a logistic loss). They satisfy the Shapley axioms of efficiency (they sum to the difference between the prediction and the baseline), symmetry, and dummy.

Formula
\phi_i = \sum_{S \subseteq F \setminus \{i\}} \frac{|S|!(|F|-|S|-1)!}{|F|!}[f_{S\cup\{i\}}(x_{S\cup\{i\}}) - f_S(x_S)]
3

Global importance is the mean absolute SHAP value across the observations used for each feature. Because it is computed from Shapley attributions rather than from tree split statistics, it avoids the cardinality bias of impurity-based (Gini) importance, which favours features with many distinct values. It still describes what the fitted model uses, so it can be misleading when features are correlated.

Formula
\bar{\phi}_i = \frac{1}{n}\sum_{j=1}^{n}|\phi_i^{(j)}|
4

For any single prediction, a waterfall or force plot shows how each feature value pushes the model output above or below the baseline (average) prediction. This local view is useful for explaining individual decisions to domain experts, regulators, or end users who need to understand why a specific record received its score.

5

Explanations should be validated before they are reported. First, check that high-importance features are substantively plausible and free of leakage, for example identifier columns. Second, assess stability: refit or resample the data several times with different random seeds, confirm that the top-ranked features and their mean absolute SHAP values remain similar, and report how many resamples were used. Third, run a permutation check on held-out data: shuffle the values of each top-ranked feature, record the drop in the chosen performance metric, and compare that drop with the drop obtained when a random noise column is shuffled in the same way. Finally, inspect SHAP dependence plots for monotonicity and interaction patterns. No universal importance threshold separates relevant from irrelevant features; the decision should rest on stability across resamples and on the size of the performance loss relative to its variability.

Common pitfalls

  • Using impurity-based (Gini) feature importance instead of SHAP-based importance, which inflates the apparent importance of high-cardinality categorical features.
  • Treating SHAP values as causal effects rather than as descriptions of the model's learned associations.
  • Skipping validation of explanations, for example not checking whether the top SHAP features are substantively plausible or free of data leakage.
  • Reading SHAP values as changes in predicted probability when the model output is on the log-odds scale, which misstates the size of each effect.
  • Reporting global SHAP importance without examining local explanations for outlier or edge-case predictions, where the global ranking may not hold.
  • Applying gradient boosting with SHAP where a well-specified logistic regression would be adequate and easier to defend to reviewers.

Frequently asked questions

Is Explainable Gradient Boosting a different model from gradient boosting?

No. The underlying predictive model is standard gradient boosting. Explainability is added as a post-hoc layer using tools such as SHAP. The model parameters and predictions are identical to a non-explainable gradient boosting fit; only the interpretation workflow differs.

Are SHAP values causal?

No. SHAP values describe how the fitted model distributes predictions across features. They reflect the model's learned associations, not causal effects. If the training data contains confounders or spurious correlations, SHAP values will reflect those too. Causal interpretation requires causal study design, not post-hoc attribution.

What should I do when two important features are strongly correlated?

With correlated features, SHAP can distribute the shared predictive signal across both features in ways that are hard to interpret individually. The allocation also depends on the feature-perturbation setting and background data chosen for TreeSHAP, so report these choices with the results. Examine SHAP dependence plots for interaction effects, and interpret the attributions jointly for the correlated group rather than assigning importance to each feature on its own.

When should I prefer logistic regression over Explainable Gradient Boosting?

Prefer logistic regression when the sample is small, when the outcome-predictor relationships are expected to be approximately linear and additive, or when reviewers require explicit, readily auditable coefficients with confidence intervals. Gradient boosting with SHAP can capture more complex structure, but it is harder to validate and more prone to overfitting when data are limited.

Which SHAP plot should I report in a paper?

For global summaries, report the SHAP summary (beeswarm) plot showing the distribution of SHAP values per feature, and a bar chart of mean absolute SHAP importance. For local explanations of key cases, use waterfall or force plots. Always accompany SHAP plots with standard performance metrics (AUC, F1, RMSE) so readers can assess overall model quality.

Related methods

Sources

  1. Lundberg, S. M., Erion, G., Chen, H., DeGrave, A., Prutkin, J. M., Nair, B., Katz, R., Himmelfarb, J., Bansal, N., & Lee, S.-I. (2020). From local explanations to global understanding with explainable AI for trees. Nature Machine Intelligence, 2, 56–67.

    Open DOI reference
  2. Molnar, C. (2022). Interpretable Machine Learning: A Guide for Making Black Box Models Explainable (2nd ed.). christophm.github.io/interpretable-ml-book/

    Open publication reference