Generate dataset for local exploration.
sample_locally(data, explained_instance, explained_var, size, method = "live", fixed_variables = NULL, seed = NULL, ...)
data | Data frame from which new dataset will be simulated. |
---|---|
explained_instance | One row data frame with the same variables as in data argument. Local exploration will be performed around this observation. |
explained_var | Name of a column with the variable to be predicted. |
size | Number of observations is a simulated dataset. |
method | If "live", new observations will be created by changing one value per observation. If "permute", new observation will be created by permuting all columns of data. If "normal", numerical features will be sampled from multivariate normal distribution specified by ... arguments mu and Sigma. |
fixed_variables | names or numeric indexes of columns which will not be changed while sampling. |
seed | Seed to set before sampling. If NULL, results will not be reproducible. |
... | Mean and covariance matrix for normal sampling method. |
list of class "live_explorer" consisting of
Dataset generated by sample_locally function with response variable.
Name of the response variable.
Instance that is being explained.
Name of used sampling method
Names of variables which were not sampled
Standard deviations of numerical variables
# NOT RUN { dataset_for_local_exploration <- sample_locally(data = wine, explained_instance = wine[5, ], explained_var = "quality", size = 50) # }