Ordinary linear regression. Calls stats::lm().

Dictionary

This Learner can be instantiated via the dictionary mlr_learners or with the associated sugar function lrn():

mlr_learners$get("regr.lm")
lrn("regr.lm")

Contrasts

To ensure reproducibility, this learner always uses the default contrasts:

Setting the option "contrasts" does not have any effect. Instead, set the respective hyperparameter or use mlr3pipelines to create dummy features.

See also

Super classes

mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrLM

Methods

Public methods

Inherited methods

Method new()

Creates a new instance of this R6 class.

Usage

LearnerRegrLM$new()


Method clone()

The objects of this class are cloneable with this method.

Usage

LearnerRegrLM$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

if (requireNamespace("stats")) { learner = mlr3::lrn("regr.lm") print(learner) # available parameters: learner$param_set$ids() }
#> <LearnerRegrLM:regr.lm> #> * Model: - #> * Parameters: list() #> * Packages: stats #> * Predict Type: response #> * Feature types: logical, integer, numeric, factor #> * Properties: weights
#> [1] "x" "y" "model" "qr" "singular.ok" #> [6] "offset" "se.fit" "scale" "df" "interval" #> [11] "level" "pred.var"