mlr3superlearner {mlr3superlearner} | R Documentation |
Implementation of the Super Learner algorithm using the 'mlr3' framework. By default, returning the discrete Super Learner. If using the ensemble Super Learner, The LASSO with an alpha value of 0 and a restriction on the lower limit of the coefficients is used as the meta-learner.
mlr3superlearner(
data,
target,
library,
outcome_type = c("binomial", "continuous"),
folds = NULL,
discrete = TRUE,
newdata = NULL,
group = NULL,
info = FALSE
)
data |
[ |
target |
[ |
library |
[ |
outcome_type |
[ |
folds |
[ |
discrete |
[ |
newdata |
[ |
group |
[ |
info |
[ |
A list of class mlr3superlearner
.
if (requireNamespace("ranger", quietly = TRUE)) {
n <- 1e3
W <- matrix(rnorm(n*3), ncol = 3)
A <- rbinom(n, 1, 1 / (1 + exp(-(.2*W[,1] - .1*W[,2] + .4*W[,3]))))
Y <- rbinom(n,1, plogis(A + 0.2*W[,1] + 0.1*W[,2] + 0.2*W[,3]^2 ))
tmp <- data.frame(W, A, Y)
mlr3superlearner(tmp, "Y", c("glm", "ranger"), "binomial")
}