Instance Level Variable Attributions as Break Down, SHAP, aggregated SHAP or Oscillations explanations. Model prediction is decomposed into parts that are attributed for particular variables. From DALEX version 1.0 this function calls the break_down or shap functions from the iBreakDown package or ceteris_paribus from the ingredients package. Find information how to use the break_down method here: https://ema.drwhy.ai/breakDown.html. Find information how to use the shap method here: https://ema.drwhy.ai/shapley.html. Find information how to use the oscillations method here: https://ema.drwhy.ai/ceterisParibusOscillations.html. aSHAP method provides explanations for a set of observations based on SHAP.
predict_parts( explainer, new_observation,..., N =if(substr(type,1,4)=="osci")500elseNULL, type ="break_down")predict_parts_oscillations(explainer, new_observation,...)predict_parts_oscillations_uni( explainer, new_observation, variable_splits_type ="uniform",...)predict_parts_oscillations_emp( explainer, new_observation, variable_splits =NULL, variables = colnames(explainer$data),...)predict_parts_break_down(explainer, new_observation,...)predict_parts_break_down_interactions(explainer, new_observation,...)predict_parts_shap(explainer, new_observation,...)predict_parts_shap_aggregated(explainer, new_observation,...)variable_attribution( explainer, new_observation,..., N =if(substr(type,1,4)=="osci")500elseNULL, type ="break_down")
Arguments
explainer: a model to be explained, preprocessed by the explain function
new_observation: a new observation for which predictions need to be explained
...: 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, aggregated_shap, oscillations, oscillations_uni, oscillations_emp, break_down or break_down_interactions.
variable_splits_type: how variable grids shall be calculated? Will be passed to ceteris_paribus.
variable_splits: named list of splits for variables. It is used by oscillations based measures. Will be passed to ceteris_paribus.
variables: names of variables for which splits shall be calculated. Will be passed to ceteris_paribus.
Returns
Depending on the type there are different classes of the resulting object. It's a data frame with calculated average response.