Skip to contents

Calls stats::glm from package stats.

Details

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: mlr3extralearners, 'stats'

Parameters

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

Custom mlr3 defaults

  • type

    • Actual default: "link"

    • Adjusted default: "response"

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

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

if (requireNamespace("stats", quietly = TRUE)) {
  learner = mlr3::lrn("regr.glm")
  print(learner)

  # available parameters:
  learner$param_set$ids()
}
#> <LearnerRegrGlm:regr.glm>
#> * Model: -
#> * Parameters: family=gaussian, type=response
#> * Packages: mlr3, mlr3extralearners, stats
#> * Predict Type: response
#> * Feature types: logical, integer, numeric, character, factor, ordered
#> * Properties: weights
#>  [1] "singular.ok" "x"           "y"           "model"       "etastart"   
#>  [6] "mustart"     "start"       "offset"      "family"      "na.action"  
#> [11] "link"        "epsilon"     "maxit"       "trace"       "dispersion" 
#> [16] "type"