Skip to contents

Computes individual observation SHAP attributions: using time-dependent SurvSHAP(t) via survex::predict_parts(type = "survshap") for survival explainers, and DALEX::predict_parts(type = "shap") for classification/regression explainers.

Usage

predict_parts_shap(
  explainer,
  new_observation,
  type = c("auto", "shap", "survshap"),
  ...
)

Arguments

explainer

An explainer object produced by explain_survival(), explain_joint(), or DALEX::explain().

new_observation

A 1-row data frame containing the observation to explain.

type

Character specifying the attribution type: "auto" (the default), "shap", or "survshap".

...

Additional arguments passed to survex::predict_parts() or DALEX::predict_parts().

Value

A predict_parts attribution object, printable and plottable with plot().