| learner_hal | R Documentation |
Constructs a learner class object for fitting a highly adaptive lasso model with hal9001::fit_hal.
learner_hal(
formula,
info = "hal9001::fit_hal",
smoothness_orders = 0,
reduce_basis = NULL,
family = "gaussian",
learner.args = NULL,
...
)
formula |
(formula) Formula specifying response and design matrix. |
info |
(character) Optional information to describe the instantiated learner object. |
smoothness_orders |
An |
reduce_basis |
Am optional |
family |
A |
learner.args |
(list) Additional arguments to learner$new(). |
... |
Additional arguments to hal9001::fit_hal. |
learner object.
## Not run:
n <- 5e2
x1 <- rnorm(n, sd = 2)
x2 <- rnorm(n)
y <- x1 + cos(x1) + rnorm(n, sd = 0.5**.5)
d <- data.frame(y, x1, x2)
lr <- learner_hal(y ~ x1 + x2, smoothness_orders = 0.5, reduce_basis = 1)
lr$estimate(d)
lr$predict(data.frame(x1 = 0, x2 = c(-1, 1)))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.