gen_resp {OptHoldoutSize} | R Documentation |
Generate response
Description
Generate random outcome (response) according to a ground-truth logistic model
Usage
gen_resp(X, coefs = NA, coefs_sd = 1, retprobs = FALSE)
Arguments
X |
Matrix of observations |
coefs |
Vector of coefficients for logistic model. If NA, random coefficients are generated. Defaults to NA |
coefs_sd |
If random coefficients are generated, use this SD (mean 0) |
retprobs |
If TRUE, return class probability; otherwise, return classes. Defaults to FALSE |
Value
Vector of length as first dimension of dim(X) with outcome classes (if retprobs==FALSE) or outcome probabilities (if retprobs==TRUE)
Examples
# See examples for model_predict
[Package OptHoldoutSize version 0.1.0.0 Index]