Classification Linear Mixed Effect Learner
Source:R/learner_lme4_classif_glmer.R
      mlr_learners_classif.glmer.RdGeneralized linear model with random effects.
Calls lme4::glmer() from lme4.
Formula
Although most mlr3 learners don't allow to specify the formula manually, and automatically
set it by valling task$formula(), this learner allows to set the formula because it's core
functionality depends it. This means that it might not always use all features that are available
in the task.
Be aware, that this can sometimes lead to unexpected error messages,
because mlr3 checks the compatibility between the learner and the task on all available features.
Parameters
| Id | Type | Default | Levels | Range | 
| formula | untyped | - | - | |
| start | untyped | NULL | - | |
| verbose | integer | 0 | \([0, \infty)\) | |
| contrasts | untyped | NULL | - | |
| optimizer | character | - | Nelder_Mead, bobyqa, nlminbwrap, nloptwrap | - | 
| restart_edge | logical | FALSE | TRUE, FALSE | - | 
| boundary.tol | numeric | 1e-05 | \([0, \infty)\) | |
| calc.derivs | logical | TRUE | TRUE, FALSE | - | 
| check.nobs.vs.rankZ | character | ignore | ignore, warning, message, stop | - | 
| check.nobs.vs.nlev | character | stop | ignore, warning, message, stop | - | 
| check.nlev.gtreq.5 | character | ignore | ignore, warning, message, stop | - | 
| check.nlev.gtr.1 | character | stop | ignore, warning, message, stop | - | 
| check.nobs.vs.nRE | character | stop | ignore, warning, message, stop | - | 
| check.rankX | character | message+drop.cols | message+drop.cols, silent.drop.cols, warn+drop.cols, stop.deficient, ignore | - | 
| check.scaleX | character | warning | warning, stop, silent.rescale, message+rescale, warn+rescale, ignore | - | 
| check.formula.LHS | character | stop | ignore, warning, message, stop | - | 
| family | untyped | "stats::binomial(link = \"logit\")" | - | |
| nAGQ | integer | 1 | \([0, \infty)\) | |
| mustart | untyped | - | - | |
| etastart | untyped | - | - | |
| check.conv.grad | untyped | "lme4::.makeCC(\"warning\", tol = 2e-3, relTol = NULL)" | - | |
| check.conv.singular | untyped | "lme4::.makeCC( action = \"message\", tol = formals(lme4::isSingular)$tol)" | - | |
| check.conv.hess | untyped | "lme4::.makeCC(action = \"warning\", tol = 1e-6)" | - | |
| optCtrl | untyped | list() | - | |
| tolPwrss | untyped | - | - | |
| compDev | logical | TRUE | TRUE, FALSE | - | 
| nAGQ0initStep | logical | TRUE | TRUE, FALSE | - | 
| check.response.not.const | untyped | "stop" | - | |
| newparams | untyped | NULL | - | |
| re.form | untyped | NULL | - | |
| random.only | logical | FALSE | TRUE, FALSE | - | 
| allow.new.levels | logical | FALSE | TRUE, FALSE | - | 
| na.action | untyped | "stats::na.pass" | - | 
Offset
If a Task contains a column with the offset role, it is automatically
incorporated during training via the offset argument in lme4::lmer().
No offset is applied during prediction for this learner.
See also
- 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. 
Super classes
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifGlmer
Methods
Inherited methods
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()
Examples
# Define the Learner and set parameter values
learner = lrn("classif.glmer",
  formula = credit_risk ~ (1 | credit_history) + job + property + telephone + savings)
# Define a Task
task = tsk("german_credit")
task$select(c("credit_history", "job", "property", "telephone", "savings"))
# Train the learner
learner$train(task)
print(learner$model)
#> $model
#> Generalized linear mixed model fit by maximum likelihood (Laplace
#>   Approximation) [glmerMod]
#>  Family: binomial  ( logit )
#> Formula: credit_risk ~ (1 | credit_history) + job + property + telephone +  
#>     savings
#>    Data: data
#>       AIC       BIC    logLik -2*log(L)  df.resid 
#> 1143.8155 1207.6163 -558.9077 1117.8155       987 
#> Random effects:
#>  Groups         Name        Std.Dev.
#>  credit_history (Intercept) 0.687   
#> Number of obs: 1000, groups:  credit_history, 5
#> Fixed Effects:
#>                                         (Intercept)  
#>                                            -0.49718  
#>                             jobunskilled - resident  
#>                                            -0.19139  
#>                        jobskilled employee/official  
#>                                            -0.13544  
#>        jobmanager/self-empl/highly qualif. employee  
#>                                            -0.02365  
#>                                propertycar or other  
#>                                             0.56577  
#> propertybuilding soc. savings agr. / life insurance  
#>                                             0.50720  
#>                                 propertyreal estate  
#>                                             1.11104  
#>                  telephoneyes (under customer name)  
#>                                            -0.26805  
#>                                 savings... < 100 DM  
#>                                            -0.33521  
#>                          savings100 <= ... < 500 DM  
#>                                            -1.08991  
#>                         savings500 <= ... < 1000 DM  
#>                                            -1.24679  
#>                               savings... >= 1000 DM  
#>                                            -1.04639  
#> 
#> $target_levels
#> [1] "good" "bad" 
#>