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(),
...
)
x_train |
Matrix or data.frame/data.table. Contains the data used to estimate the (conditional) distributions for the features needed to properly estimate the conditional expectations in the Shapley formula. |
x_explain |
Matrix or data.frame/data.table. Contains the the features, whose predictions ought to 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 we set this value equal to the mean of the response variable in our training data, but other choices such as the mean of the predictions in the training data are also reasonable. |
output_size |
Scalar integer. Specifies the dimension of the output from the prediction model for every observation. |
max_n_coalitions |
Integer.
The 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 randomness based code is being run.
If |
feature_specs |
List. The output from
|
type |
Character.
Either "regular" or "forecast" corresponding to function |
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.
Specifies the verbosity (printout detail level) through one or more of strings
|
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 use to remove random components like timing from the object output when comparing output with testthat.
Defaults to |
init_time |
POSIXct object.
The time when the |
prev_shapr_object |
|
asymmetric |
Logical.
Not applicable for (regular) non-causal or asymmetric 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 |
... |
Further arguments passed to specific approaches, see below. |
A internal list, containing parameters, info, data and computations needed for the later computations. 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.