setup | R Documentation |
check_setup
setup(
x_train,
x_explain,
approach,
phi0,
output_size = 1,
max_n_coalitions,
group,
n_MC_samples,
seed,
feature_specs,
type = "regular",
horizon = NULL,
y = NULL,
xreg = NULL,
train_idx = NULL,
explain_idx = NULL,
explain_y_lags = NULL,
explain_xreg_lags = NULL,
group_lags = NULL,
verbose,
iterative = NULL,
iterative_args = list(),
is_python = FALSE,
testing = FALSE,
init_time = NULL,
prev_shapr_object = NULL,
asymmetric = FALSE,
causal_ordering = NULL,
confounding = NULL,
output_args = list(),
extra_computation_args = list(),
model_class,
...
)
x_train |
Matrix or data.frame/data.table. Data used to estimate the (conditional) feature distributions needed to properly estimate the conditional expectations in the Shapley formula. |
x_explain |
Matrix or data.frame/data.table. Features for which predictions should be explained. |
approach |
Character vector of length |
phi0 |
Numeric. The prediction value for unseen data, i.e., an estimate of the expected prediction without conditioning on any features. Typically set this equal to the mean of the response in the training data, but alternatives such as the mean of the training predictions are also reasonable. |
output_size |
Scalar integer. Specifies the dimension of the output from the prediction model for every observation. |
max_n_coalitions |
Integer.
Upper limit on the number of unique feature/group coalitions to use in the iterative procedure
(if |
group |
List.
If |
n_MC_samples |
Positive integer.
For most approaches, it indicates the maximum number of samples to use in the Monte Carlo integration
of every conditional expectation.
For |
seed |
Positive integer.
Specifies the seed before any code involving randomness is run.
If |
feature_specs |
List. The output from
|
type |
Character. Either "regular" or "forecast", matching the function the call originated from, and thus the type of explanation to generate. |
horizon |
Numeric.
The forecast horizon to explain. Passed to the |
y |
Matrix, data.frame/data.table or a numeric vector. Contains the endogenous variables used to estimate the (conditional) distributions needed to properly estimate the conditional expectations in the Shapley formula including the observations to be explained. |
xreg |
Matrix, data.frame/data.table or a numeric vector. Contains the exogenous variables used to estimate the (conditional) distributions needed to properly estimate the conditional expectations in the Shapley formula including the observations to be explained. As exogenous variables are used contemporaneously when producing a forecast, this item should contain nrow(y) + horizon rows. |
train_idx |
Numeric vector.
The row indices in data and reg denoting points in time to use when estimating the conditional expectations in
the Shapley value formula.
If |
explain_idx |
Numeric vector. The row indices in data and reg denoting points in time to explain. |
explain_y_lags |
Numeric vector.
Denotes the number of lags that should be used for each variable in |
explain_xreg_lags |
Numeric vector.
If |
group_lags |
Logical.
If |
verbose |
String vector or NULL.
Controls verbosity (printout detail level) via one or more of |
iterative |
Logical or NULL.
If |
iterative_args |
Named list.
Specifies the arguments for the iterative procedure.
See |
is_python |
Logical.
Indicates whether the function is called from the Python wrapper.
Default is FALSE, which is never changed when calling the function via |
testing |
Logical.
Only used to remove random components, like timing, from the output when comparing with testthat.
Defaults to |
init_time |
POSIXct.
The time when the |
prev_shapr_object |
|
asymmetric |
Logical.
Not applicable for (regular) non-causal explanations.
If |
causal_ordering |
List.
Not applicable for (regular) non-causal or asymmetric explanations.
|
confounding |
Logical vector.
Not applicable for (regular) non-causal or asymmetric explanations.
|
output_args |
Named list.
Specifies certain arguments related to the output of the function.
See |
extra_computation_args |
Named list.
Specifies extra arguments related to the computation of the Shapley values.
See |
model_class |
Character string.
The class of the model object, e.g., "lm", "glm", "xgboost", etc. obtained by |
... |
Further arguments passed to specific approaches, see below. |
An internal list containing parameters, info, data, and computations needed for later steps. The list is expanded and modified in other functions.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.