View source: R/asymmetric_and_casual_Shapley.R
create_marginal_data_training | R Documentation |
Sample observations from the empirical distribution P(X) using the training dataset.
create_marginal_data_training(
x_train,
n_explain,
Sbar_features,
n_MC_samples = 1000,
stable_version = TRUE
)
x_train |
Data.table with training data. |
Sbar_features |
Vector of integers containing the features indices to generate marginal observations for.
That is, if |
stable_version |
Logical. If |
Data table of dimension n_MC_samples
\times
length(Sbar_features)
with the sampled observations.
Lars Henry Berge Olsen
## Not run:
data("airquality")
data <- data.table::as.data.table(airquality)
data <- data[complete.cases(data), ]
x_var <- c("Solar.R", "Wind", "Temp", "Month")
y_var <- "Ozone"
ind_x_explain <- 1:6
x_train <- data[-ind_x_explain, ..x_var]
x_train
shapr:::create_marginal_data_training(
x_train = x_train,
Sbar_features = c(1, 4),
n_MC_samples = 10
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.