View source: R/learner_isoreg.R
| learner_isoreg | R Documentation |
Constructs a learner class object for isotonic regression with isoregw.
learner_isoreg(formula, info = "targeted::isoregw", learner.args = NULL, ...)
formula |
(formula) Formula specifying response and design matrix. |
info |
(character) Optional information to describe the instantiated learner object. |
learner.args |
(list) Additional arguments to learner$new(). |
... |
Additional arguments to isoregw. |
learner object.
x <- runif(5e3, -5, 5)
pr <- lava::expit(-1 + x)
y <- rbinom(length(pr), 1, pr)
d <- data.frame(y, x)
lr <- learner_isoreg(y ~ x)
lr$estimate(d)
pr_iso <- lr$predict(d)
if (interactive()) {
plot(pr ~ x, cex=0.3)
lines(sort(x), pr_iso[order(x)], col="red", type="s")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.