prepare_data: Generate data used for predictions

Description Usage Arguments

View source: R/observations.R

Description

Generate data used for predictions

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
prepare_data(x, ...)

## S3 method for class 'empirical'
prepare_data(x, seed = 1, n_samples = 1000, index_features = NULL, ...)

## S3 method for class 'gaussian'
prepare_data(x, seed = 1, n_samples = 1000, index_features = NULL, ...)

## S3 method for class 'copula'
prepare_data(
  x,
  x_test_gaussian = 1,
  seed = 1,
  n_samples = 1000,
  index_features = NULL,
  ...
)

## S3 method for class 'ctree'
prepare_data(
  x,
  seed = 1,
  n_samples = 1000,
  index_features = NULL,
  mc_cores = 1,
  mc_cores_create_ctree = mc_cores,
  mc_cores_sample_ctree = mc_cores,
  ...
)

Arguments

x

Explainer object. See explain for more information.

...

Currently not used.

seed

Positive integer. If NULL the seed will be inherited from the calling environment.

n_samples

Integer. The number of obs to sample from the leaf if sample = TRUE or if sample = FALSE but n_samples is less than the number of obs in the leaf.

index_features

List. Default is NULL but if either various methods are being used or various mincriterion are used for different numbers of conditioned features, this will be a list with the features to pass.

x_test_gaussian

Matrix. Test data quantile-transformed to standard Gaussian variables. Only applicable if approach = "empirical".

mc_cores

Integer. Only for class ctree currently. The number of cores to use in paralellization of the tree building (create_ctree) and tree sampling (sample_ctree). Defaults to 1. Note: Uses parallel::mclapply which relies on forking, i.e. uses only 1 core on Windows systems.

mc_cores_create_ctree

Integer. Same as mc_cores, but specific for the tree building function #' Defaults to mc_cores.

mc_cores_sample_ctree

Integer. Same as mc_cores, but specific for the tree building prediction function. Defaults to mc_cores.


shapr documentation built on Jan. 28, 2021, 5:06 p.m.