View source: R/experiment_utils.R
generate_bandit_data | R Documentation |
Generates covariates and potential outcomes for a classification dataset.
generate_bandit_data(xs = NULL, y = NULL, noise_std = 1, signal_strength = 1)
xs |
Optional matrix. Covariates of shape |
y |
Optional vector. Labels of length |
noise_std |
Numeric. Standard deviation of the noise added to the potential outcomes. Default is |
signal_strength |
Numeric. Strength of the signal in the potential outcomes. Default is |
A list containing the generated data (xs
, ys
, muxs
, A
, p
, K
) and the true class probabilities (mus
).
data <- generate_bandit_data(xs = as.matrix(iris[,1:4]),
y = as.numeric(iris[,5]),
noise_std = 0.1,
signal_strength = 1.0)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.