glmnetr: Nested Cross Validation for the Relaxed Lasso and Other Machine Learning Models

Cross validation informed Relaxed LASSO (or more generally elastic net), gradient boosting machine ('xgboost'), Random Forest ('RandomForestSRC'), Oblique Random Forest ('aorsf'), Artificial Neural Network (ANN), Recursive Partitioning ('RPART') or step wise regression models are fit. Cross validation leave out samples (leading to nested cross validation) or bootstrap out-of-bag samples are used to evaluate and compare performances between these models with results presented in tabular or graphical means. Calibration plots can also be generated, again based upon (outer nested) cross validation or bootstrap leave out (out of bag) samples. For some datasets, for example when the design matrix is not of full rank, 'glmnet' may have very long run times when fitting the relaxed lasso model, from our experience when fitting Cox models on data with many predictors and many patients. This may be remedied by using the 'path=TRUE' option, which is passed to the glmnet() and cv.glmnet() calls. Other packages doing similar include 'nestedcv' <https://cran.r-project.org/package=nestedcv>, 'glmnetSE' <https://cran.r-project.org/package=glmnetSE> which may provide different functionality when performing a nested CV. Use of the 'glmnetr' has many similarities to the 'glmnet' package and it could be helpful for the user of 'glmnetr' also become familiar with the 'glmnet' package <https://cran.r-project.org/package=glmnet>, with the "An Introduction to 'glmnet'" and "The Relaxed Lasso" being especially useful in this regard.

Version: 0.6-1
Depends: R (≥ 3.4.0)
Imports: glmnet, survival, Matrix, xgboost, smoof, mlrMBO, ParamHelpers, randomForestSRC, rpart, torch, aorsf, DiceKriging, rgenoud
Suggests: R.rsp
Published: 2025-05-10
DOI: 10.32614/CRAN.package.glmnetr
Author: Walter K Kremers ORCID iD [aut, cre], Nicholas B Larson [ctb]
Maintainer: Walter K Kremers <kremers.walter at mayo.edu>
License: GPL-3
Copyright: Mayo Foundation for Medical Education and Research
NeedsCompilation: no
CRAN checks: glmnetr results

Documentation:

Reference manual: glmnetr.pdf
Vignettes: An Overview of glmnetr (source)
Calibration of Machine Learning Models (source)
Elastic net models (source)
Ridge and Lasso (source)
Using ann_tab_cv (source)
Using stepreg (source)

Downloads:

Package source: glmnetr_0.6-1.tar.gz
Windows binaries: r-devel: glmnetr_0.5-5.zip, r-release: glmnetr_0.5-5.zip, r-oldrel: glmnetr_0.5-5.zip
macOS binaries: r-release (arm64): glmnetr_0.6-1.tgz, r-oldrel (arm64): glmnetr_0.6-1.tgz, r-release (x86_64): glmnetr_0.6-1.tgz, r-oldrel (x86_64): glmnetr_0.6-1.tgz
Old sources: glmnetr archive

Linking:

Please use the canonical form https://CRAN.R-project.org/package=glmnetr to link to this page.