R/LearnerClassifGlmnet.R
mlr_learners_classif.glmnet.RdGeneralized linear models with elastic net regularization.
Calls glmnet::glmnet() from package glmnet.
Caution: This learner is different to _glmnet in that it does not use the
internal optimization of lambda. The parameter needs to be tuned by the user.
Essentially, one needs to tune parameter s which is used at predict-time.
See https://stackoverflow.com/questions/50995525/ for more information.
This Learner can be instantiated via the dictionary mlr_learners or with the associated sugar function lrn():
mlr_learners$get("classif.glmnet") lrn("classif.glmnet")
Friedman J, Hastie T, Tibshirani R (2010). “Regularization Paths for Generalized Linear Models via Coordinate Descent.” Journal of Statistical Software, 33(1), 1--22. doi: 10.18637/jss.v033.i01 .
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifGlmnet
new()Creates a new instance of this R6 class.
LearnerClassifGlmnet$new()
clone()The objects of this class are cloneable with this method.
LearnerClassifGlmnet$clone(deep = FALSE)
deepWhether to make a deep clone.
if (requireNamespace("glmnet")) { learner = mlr3::lrn("classif.glmnet") print(learner) # available parameters: learner$param_set$ids() }#> <LearnerClassifGlmnet:classif.glmnet> #> * Model: - #> * Parameters: list() #> * Packages: glmnet #> * Predict Type: response #> * Feature types: logical, integer, numeric #> * Properties: multiclass, twoclass, weights#> [1] "alpha" "type.measure" "s" "lambda.min.ratio" #> [5] "lambda" "standardize" "intercept" "thresh" #> [9] "dfmax" "pmax" "exclude" "penalty.factor" #> [13] "lower.limits" "upper.limits" "maxit" "type.logistic" #> [17] "type.multinomial" "keep" "parallel" "trace.it" #> [21] "alignment" "grouped" "offset" "relax" #> [25] "fdev" "devmax" "eps" "epsnr" #> [29] "big" "mnlam" "pmin" "exmx" #> [33] "prec" "mxit" "mxitnr" "newoffset" #> [37] "exact" "gamma"