sample_locally: Generate dataset for local exploration.

Description Usage Arguments Value Examples

View source: R/explore.R

Description

Generate dataset for local exploration.

Usage

1
2
sample_locally(data, explained_instance, explained_var, size,
  method = "live", fixed_variables = NULL, seed = NULL, ...)

Arguments

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.

Value

list of class "live_explorer" consisting of

data

Dataset generated by sample_locally function with response variable.

target

Name of the response variable.

explained_instance

Instance that is being explained.

sampling_method

Name of used sampling method

fixed_variables

Names of variables which were not sampled

sdevations

Standard deviations of numerical variables

Examples

1
2
3
4
5
6
7
## Not run: 
dataset_for_local_exploration <- sample_locally(data = wine,
                                                explained_instance = wine[5, ],
                                                explained_var = "quality",
                                                size = 50)

## End(Not run)

MI2DataLab/live documentation built on Aug. 21, 2019, 6:05 p.m.