Tree SHAP contributions of a boosted model
booster_contributions.RdEach design column's contribution to each row's prediction on the link
scale, from the engine's own path-dependent Tree SHAP (LightGBM's
type = "contrib", XGBoost's predcontrib = TRUE), with no tree code
here. The bias holds each row's expected value plus its offset and the
fit's base, so bias + rowSums(values) is the link-scale prediction: the
log of the mean for a log-link family.
Arguments
- object
A
booster_modelfrombooster_fit().- newdata
A data frame.
- offset
An optional offset added to the formula's.