Calls glmnet::glmnet().

Use LearnerSurvGlmnet and LearnerSurvCVGlmnet for glmnets without and with internal cross-validation, respectively. Tuning using the internal optimizer in LearnerSurvCVGlmnet may be more efficient when tuning lambda only. However, for tuning multiple hyperparameters, mlr3tuning and LearnerSurvGlmnet will likely give better results.

Parameter s (value of the regularization parameter used for predictions) is set to the median of the lambda sequence by default, but needs to be tuned by the user.


R6::R6Class() inheriting from LearnerSurv.



Meta Information

  • Type: "surv"

  • Predict Types: crank, lp

  • Feature Types: integer, numeric, factor

  • Packages: glmnet survival


Jerome Friedman, Trevor Hastie, Robert Tibshirani (2010). Regularization Paths for Generalized Linear Models via Coordinate Descent. Journal of Statistical Software, 33(1), 1-22. doi: 10.18637/jss.v033.i01 .

See also


library(mlr3) task = tgen("simsurv")$generate(200) learner = lrn("surv.glmnet") resampling = rsmp("cv", folds = 3) resample(task, learner, resampling)
#> <ResampleResult> of 3 iterations #> * Task: simsurv #> * Learner: surv.glmnet #> * Warnings: 0 in 0 iterations #> * Errors: 0 in 0 iterations