Skip to contents

Generalized linear model. Calls stats::glm() from base package 'stats'. For logistic regression please use mlr_learners_classif.log_reg.

Dictionary

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

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

Meta Information

  • Task type: “regr”

  • Predict Types: “response”, “se”

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

  • Required Packages: mlr3, mlr3extralearners, 'stats'

Parameters

IdTypeDefaultLevelsRange
singular.oklogicalTRUETRUE, FALSE-
xlogicalFALSETRUE, FALSE-
ylogicalTRUETRUE, FALSE-
modellogicalTRUETRUE, FALSE-
etastartuntyped--
mustartuntyped--
startuntypedNULL-
offsetuntyped--
familycharactergaussiangaussian, poisson, quasipoisson, Gamma, inverse.gaussian-
na.actioncharacter-na.omit, na.pass, na.fail, na.exclude-
linkcharacter-logit, probit, cauchit, cloglog, identity, log, sqrt, 1/mu^2, inverse-
epsilonnumeric1e-08\((-\infty, \infty)\)
maxitnumeric25\((-\infty, \infty)\)
tracelogicalFALSETRUE, FALSE-
dispersionuntypedNULL-
typecharacterlinkresponse, link, terms-

Initial parameter values

  • type

    • Actual default: "link"

    • Adjusted default: "response"

    • Reason for change: Response scale more natural for predictions.

References

Hosmer Jr, W D, Lemeshow, Stanley, Sturdivant, X R (2013). Applied logistic regression, volume 398. John Wiley & Sons.

See also

Author

salauer

Super classes

mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrGlm

Methods

Inherited methods


Method new()

Creates a new instance of this R6 class.

Usage


Method clone()

The objects of this class are cloneable with this method.

Usage

LearnerRegrGlm$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

learner = mlr3::lrn("regr.glm")
print(learner)
#> <LearnerRegrGlm:regr.glm>: Generalized Linear Regression
#> * Model: -
#> * Parameters: family=gaussian, type=response
#> * Packages: mlr3, mlr3extralearners, stats
#> * Predict Types:  [response], se
#> * Feature Types: logical, integer, numeric, character, factor, ordered
#> * Properties: weights

# available parameters:
learner$param_set$ids()
#>  [1] "singular.ok" "x"           "y"           "model"       "etastart"   
#>  [6] "mustart"     "start"       "offset"      "family"      "na.action"  
#> [11] "link"        "epsilon"     "maxit"       "trace"       "dispersion" 
#> [16] "type"