Generalized Additive Quantile Regression Model
mlr_learners_regr.qgam.Rd
Quantile Regression with generalized additive models.
Calls qgam::qgam()
from package qgam.
Form
For the form
parameter, a gam formula specific to the Task is required (see example and ?mgcv::formula.gam
).
If no formula is provided, a fallback formula using all features in the task is used that will make the Learner behave like Linear Quantile Regression.
The features specified in the formula need to be the same as columns with col_roles "feature" in the task.
Quantile
The quantile for the Learner, i.e. qu
parameter from qgam::qgam()
, is set using the value specified in learner$quantiles
.
Parameters
Id | Type | Default | Levels | Range |
form | untyped | - | - | |
lsig | numeric | - | \((-\infty, \infty)\) | |
err | numeric | - | \([0, 1]\) | |
cluster | untyped | NULL | - | |
multicore | logical | - | TRUE, FALSE | - |
ncores | numeric | - | \((-\infty, \infty)\) | |
paropts | untyped | list() | - | |
link | untyped | "identity" | - | |
argGam | untyped | - | - | |
discrete | logical | FALSE | TRUE, FALSE | - |
block.size | integer | 1000 | \((-\infty, \infty)\) | |
unconditional | logical | FALSE | TRUE, FALSE | - |
References
Fasiolo, Matteo, Wood, N. S, Zaffran, Margaux, Nedellec, Raphael, Goude, Yannig (2017). “Fast Calibrated Additive Quantile Regression.” Journal of the American Statistical Association, 116, 1402–1412. doi:10.1080/01621459.2020.1725521 .
See also
as.data.table(mlr_learners)
for a table of available Learners in the running session (depending on the loaded packages).Chapter in the mlr3book: https://mlr3book.mlr-org.com/basics.html#learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Super classes
mlr3::Learner
-> mlr3::LearnerRegr
-> LearnerRegrQGam
Examples
# simple example
t = mlr3::tsk("mtcars")
l = mlr3::lrn("regr.qgam")
t$select(c("cyl", "am", "disp", "hp"))
l$param_set$values$form = mpg ~ cyl + am + s(disp) + s(hp)
l$quantiles = 0.25
l$train(t)
#> Estimating learning rate. Each dot corresponds to a loss evaluation.
#> qu = 0.25...................done
l$model
#>
#> Family: elf
#> Link function: identity
#>
#> Formula:
#> mpg ~ cyl + am + s(disp) + s(hp)
#>
#> Estimated degrees of freedom:
#> 7.79 1.00 total = 11.79
#>
#> REML score: 72.30896
l$predict(t)
#> <PredictionRegr> for 32 observations:
#> row_ids truth q0.25 response
#> 1 21.0 20.08142 20.08142
#> 2 21.0 20.08142 20.08142
#> 3 22.8 22.91407 22.91407
#> --- --- --- ---
#> 30 19.7 18.09929 18.09929
#> 31 15.0 13.42599 13.42599
#> 32 21.4 22.21132 22.21132