Generates covariates and potential outcomes for a classification dataset.
Arguments
- xs
Optional matrix. Covariates of shape
[A, p]
, whereA
is the number of observations andp
is the number of features. Default isNULL
. Must not contain NA values.- y
Optional vector. Labels of length
A
. Default isNULL
. Must not contain NA values.- noise_std
Numeric. Standard deviation of the noise added to the potential outcomes. Default is
1.0
. Must be a non-negative number.- signal_strength
Numeric. Strength of the signal in the potential outcomes. Default is
1.0
.
Value
A list containing the generated data (xs
, ys
, muxs
, A
, p
, K
) and the true class probabilities (mus
).
Examples
data <- generate_bandit_data(xs = as.matrix(iris[,1:4]),
y = as.numeric(iris[,5]),
noise_std = 0.1,
signal_strength = 1.0)