mlr_learners_regr.glm | R Documentation |
Generalized linear model.
Calls stats::glm()
from base package 'stats'.
For logistic regression please use mlr_learners_classif.log_reg
.
This Learner can be instantiated via lrn():
lrn("regr.glm")
Task type: “regr”
Predict Types: “response”, “se”
Feature Types: “logical”, “integer”, “numeric”, “character”, “factor”, “ordered”
Required Packages: mlr3, mlr3extralearners, 'stats'
Id | Type | Default | Levels | Range |
singular.ok | logical | TRUE | TRUE, FALSE | - |
x | logical | FALSE | TRUE, FALSE | - |
y | logical | TRUE | TRUE, FALSE | - |
model | logical | TRUE | TRUE, FALSE | - |
etastart | untyped | - | - | |
mustart | untyped | - | - | |
start | untyped | NULL | - | |
offset | untyped | - | - | |
family | character | gaussian | gaussian, poisson, quasipoisson, Gamma, inverse.gaussian | - |
na.action | character | - | na.omit, na.pass, na.fail, na.exclude | - |
link | character | - | logit, probit, cauchit, cloglog, identity, log, sqrt, 1/mu^2, inverse | - |
epsilon | numeric | 1e-08 | (-\infty, \infty) |
|
maxit | numeric | 25 | (-\infty, \infty) |
|
trace | logical | FALSE | TRUE, FALSE | - |
dispersion | untyped | NULL | - | |
type | character | link | response, link, terms | - |
type
Actual default: "link"
Adjusted default: "response"
Reason for change: Response scale more natural for predictions.
mlr3::Learner
-> mlr3::LearnerRegr
-> LearnerRegrGlm
new()
Creates a new instance of this R6 class.
LearnerRegrGlm$new()
clone()
The objects of this class are cloneable with this method.
LearnerRegrGlm$clone(deep = FALSE)
deep
Whether to make a deep clone.
salauer
Hosmer Jr, W D, Lemeshow, Stanley, Sturdivant, X R (2013). Applied logistic regression, volume 398. John Wiley & Sons.
Dictionary of Learners: mlr3::mlr_learners.
as.data.table(mlr_learners)
for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/basics.html#learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner
learner = mlr3::lrn("regr.glm")
print(learner)
# Define a Task
task = mlr3::tsk("mtcars")
# Create train and test set
ids = mlr3::partition(task)
# Train the learner on the training ids
learner$train(task, row_ids = ids$train)
print(learner$model)
# Make predictions for the test rows
predictions = learner$predict(task, row_ids = ids$test)
# Score the predictions
predictions$score()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.