Ordinary linear regression.
Calls stats::lm().
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")
To ensure reproducibility, this learner always uses the default contrasts:
contr.treatment() for unordered factors, and
contr.poly() for ordered factors.
Setting the option "contrasts" does not have any effect.
Instead, set the respective hyperparameter or use mlr3pipelines to create dummy features.
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrLM
new()Creates a new instance of this R6 class.
LearnerRegrLM$new()
clone()The objects of this class are cloneable with this method.
LearnerRegrLM$clone(deep = FALSE)
deepWhether to make a deep clone.
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"