mlr_learners_regr.gam | R Documentation |
Generalized additive models. Calls mgcv::gam()
from package mgcv.
A gam formula specific to the task at hand is required for the formula
parameter (see example and ?mgcv::formula.gam
). Beware, if no formula is provided, a fallback formula is
used that will make the gam behave like a glm (this behavior is required
for the unit tests). Only features specified in the formula will be used,
superseding columns with col_roles "feature" in the task.
This Learner can be instantiated via lrn():
lrn("regr.gam")
Task type: “regr”
Predict Types: “response”, “se”
Feature Types: “logical”, “integer”, “numeric”, “factor”
Required Packages: mlr3, mlr3extralearners, mgcv
Id | Type | Default | Levels | Range |
family | character | gaussian | gaussian, poisson | - |
formula | untyped | - | - | |
offset | untyped | NULL | - | |
method | character | GCV.Cp | GCV.Cp, GACV.Cp, REML, P-REML, ML, P-ML | - |
optimizer | untyped | c("outer", "newton") | - | |
scale | numeric | 0 | (-\infty, \infty) |
|
select | logical | FALSE | TRUE, FALSE | - |
knots | untyped | NULL | - | |
sp | untyped | NULL | - | |
min.sp | untyped | NULL | - | |
H | untyped | NULL | - | |
gamma | numeric | 1 | [1, \infty) |
|
paraPen | untyped | NULL | - | |
G | untyped | NULL | - | |
in.out | untyped | NULL | - | |
drop.unused.levels | logical | TRUE | TRUE, FALSE | - |
drop.intercept | logical | FALSE | TRUE, FALSE | - |
nthreads | integer | 1 | [1, \infty) |
|
irls.reg | numeric | 0 | [0, \infty) |
|
epsilon | numeric | 1e-07 | [0, \infty) |
|
maxit | integer | 200 | (-\infty, \infty) |
|
trace | logical | FALSE | TRUE, FALSE | - |
mgcv.tol | numeric | 1e-07 | [0, \infty) |
|
mgcv.half | integer | 15 | [0, \infty) |
|
rank.tol | numeric | 1.490116e-08 | [0, \infty) |
|
nlm | untyped | list() | - | |
optim | untyped | list() | - | |
newton | untyped | list() | - | |
outerPIsteps | integer | 0 | [0, \infty) |
|
idLinksBases | logical | TRUE | TRUE, FALSE | - |
scalePenalty | logical | TRUE | TRUE, FALSE | - |
efs.lspmax | integer | 15 | [0, \infty) |
|
efs.tol | numeric | 0.1 | [0, \infty) |
|
scale.est | character | fletcher | fletcher, pearson, deviance | - |
nei | untyped | - | - | |
ncv.threads | integer | 1 | [1, \infty) |
|
edge.correct | logical | FALSE | TRUE, FALSE | - |
block.size | integer | 1000 | (-\infty, \infty) |
|
unconditional | logical | FALSE | TRUE, FALSE | - |
mlr3::Learner
-> mlr3::LearnerRegr
-> LearnerRegrGam
new()
Creates a new instance of this R6 class.
LearnerRegrGam$new()
clone()
The objects of this class are cloneable with this method.
LearnerRegrGam$clone(deep = FALSE)
deep
Whether to make a deep clone.
pierrecamilleri
Hastie, J T, Tibshirani, J R (2017). Generalized additive models. Routledge.
Wood, Simon (2012). “mgcv: Mixed GAM Computation Vehicle with GCV/AIC/REML smoothness estimation.”
# simple example
t = mlr3::tsk("mtcars")
l = mlr3::lrn("regr.gam")
l$param_set$values$formula = mpg ~ cyl + am + s(disp) + s(hp)
l$train(t)
l$model
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.