Chapter 28 Packages

28.1 Arguments

Here we present list of arguments in explainers from DrWhy. All explainers use unified set of arguments. All of them are generic with two specific implementations *.explainer and *.default. The first one is working for objects created with DALEX2::explain() function.

Common core of arguments

  • x a model to be explained, or an explainer created with function DALEX2::explain().
  • data validation dataset. Used to determine univariate distributions, calculation of quantiles, correlations and so on. It will be extracted from x if it’s an explainer.
  • predict_function predict function that operates on the model x. Since the model is a black box, the predict_function is the only interface to access values from the model. It should be a function that takes at least a model x and data and returns vector of predictions. If model response has more than a single number (like multiclass models) then this function should return a marix/data.frame of the size m x d, where m is the number of observations while d is the dimensionality of model response. It will be extracted from x if it’s an explainer.
  • new_observation an observation/observations to be explained. Required for local/instance level explainers. Columns in should correspond to columns in the data argument.
  • ... other parameters.
  • label name of the model. By default it’s extracted from the class attribute of the model

Function specific arguments

  • keep_distributions if TRUE, then distributions of partial predictions is stored and can be plotted with the generic plot().