Predict spatial parts
predict_spatial_parts.Rd
This function calculates the attributions of the model
(Break Down, SHAP, or Oscillations explanations) for each observation in the raster.
Model predictions are decomposed into parts that are attributed for particular variables,
and then the attributions are assigned to the corresponding cells in the raster.
See the documentation of the DALEX::predict_parts()
function for more details.
Usage
predict_spatial_parts(
explainer,
raster_obs,
maxcell = 1000,
...,
N = if (substr(type, 1, 4) == "osci") 500 else NULL,
type = "break_down"
)
Arguments
- explainer
a model to be explained, preprocessed by the
DALEX::explain()
function- raster_obs
a raster object with the observations to be explained (predictors used in the model)
- maxcell
the maximum number of cells in the raster. If the number of cells in the raster is greater than
maxcell
, the function will samplemaxcell
cells from the raster. By default 1000- ...
other parameters that will be passed to
iBreakDown::break_down()
- N
the maximum number of observations used for calculation of attributions. By default NULL (use all) or 500 (for oscillations)
- type
the type of variable attributions. Either
shap
,oscillations
,oscillations_uni
,oscillations_emp
,break_down
orbreak_down_interactions
Value
A raster object with the same dimensions as raster_obs
. The number of layers equal to the number of variables in the model or the number of variables in the model plus one if type
is not shap
.
References
Lundberg, S. (2017). A unified approach to interpreting model predictions. arXiv preprint arXiv:1705.07874.
Staniak, M., & Biecek, P. (2018). Explanations of model predictions with live and breakDown packages. arXiv preprint arXiv:1804.01955.
Biecek, P., & Burzykowski, T. (2021). Explanatory model analysis: explore, explain, and examine predictive models. Chapman and Hall/CRC.