setup | R Documentation |
check_setup
setup(
x_train,
x_explain,
approach,
prediction_zero,
output_size = 1,
n_combinations,
group,
n_samples,
n_batches,
seed,
keep_samp_for_vS,
feature_specs,
MSEv_uniform_comb_weights = TRUE,
type = "normal",
horizon = NULL,
y = NULL,
xreg = NULL,
train_idx = NULL,
explain_idx = NULL,
explain_y_lags = NULL,
explain_xreg_lags = NULL,
group_lags = NULL,
timing,
verbose,
is_python = FALSE,
...
)
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 |
A matrix or data.frame/data.table. Contains the the features, whose predictions ought to be explained. |
approach |
Character vector of length |
prediction_zero |
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 |
TODO: Document |
n_combinations |
Integer.
If |
group |
List.
If |
n_samples |
Positive integer. Indicating the maximum number of samples to use in the Monte Carlo integration for every conditional expectation. See also details. |
n_batches |
Positive integer (or NULL).
Specifies how many batches the total number of feature combinations should be split into when calculating the
contribution function for each test observation.
The default value is NULL which uses a reasonable trade-off between RAM allocation and computation speed,
which depends on |
seed |
Positive integer.
Specifies the seed before any randomness based code is being run.
If |
keep_samp_for_vS |
Logical.
Indicates whether the samples used in the Monte Carlo estimation of v_S should be returned
(in |
feature_specs |
List. The output from
|
MSEv_uniform_comb_weights |
Logical. If |
type |
Character.
Either "normal" 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 contemporaneusly 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 |
timing |
Logical.
Whether the timing of the different parts of the |
verbose |
An integer specifying the level of verbosity. If |
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 |
... |
Further arguments passed to specific approaches |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.