mlr_learners_regr.mqgam: Generalized Additive Quantile Regression Model for Multiple...

mlr_learners_regr.mqgamR Documentation

Generalized Additive Quantile Regression Model for Multiple Quantiles

Description

Quantile Regression with generalized additive models for fitting a learner on multiple quantiles simultaneously. Calls qgam::mqgam() 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 quantiles for the Learner, i.e. qu parameter from qgam::mqgam(), is set using the values specified in learner$quantiles. The response quantile can be specified using learner$quantile_response.

Dictionary

This Learner can be instantiated via lrn():

lrn("regr.mqgam")

Meta Information

  • Task type: “regr”

  • Predict Types: “response”, “se”, “quantiles”

  • Feature Types: “logical”, “integer”, “numeric”, “factor”

  • Required Packages: mlr3, qgam

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 -

Super classes

mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrMQGam

Methods

Public methods

Inherited methods

Method new()

Creates a new instance of this R6 class.

Usage
LearnerRegrMQGam$new()

Method clone()

The objects of this class are cloneable with this method.

Usage
LearnerRegrMQGam$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Author(s)

lona-k

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. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1080/01621459.2020.1725521")}.

See Also

Examples


# Define the Learner
learner = mlr3::lrn("regr.mqgam")
learner$param_set$values$form = mpg ~ cyl + am + s(disp) + s(hp)
learner$quantiles = c(0.05, 0.5, 0.95)
learner$quantile_response = 0.5
print(learner)

# Define a Task
task = mlr3::tsk("mtcars")
task$select(c("cyl", "am", "disp", "hp"))

# Create train and test set
ids = mlr3::partition(task)

# Train the learner on the training ids
learner$train(task, row_ids = ids$train)

# Make predictions for the test rows
predictions = learner$predict(task, row_ids = ids$test)

# Score the predictions
predictions$score()


mlr-org/mlr3extralearners documentation built on June 11, 2025, 7:06 p.m.