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

Cross validation informed Relaxed LASSO, Artificial Neural Network (ANN), gradient boosting machine ('xgboost'), Recursive Partitioning ('RPART') or step wise regression models are fit. It fits all these model as extensions of linear, logistic and Cox regression models. The package can fit all these models in a single call, and performs nested cross validation allowing the user to evaluate and compare the performances of these different models. The package fits these models using other packages including 'glmnet', 'survival', 'xgboost', 'rpart' and 'torch'. For the relaxed lasso models 'glmnetr' uses 'stat' and 'survival' to obtain stable model fits, and obtain these often more quickly. This too might be achieved using the 'path=TRUE' option in 'glmnet'. While the package fits nested cross validation for the lasso and other models, it does not fit the general elastic net model. If you are fitting not a relaxed lasso model but an elastic-net model, then the R-packages 'nestedcv' <>, 'glmnetSE' <> or others may provide greater functionality when performing a nested CV. As with the 'glmnet' package, this package passes most relevant information to the output object which can be evaluated using plot, summary() and predict() functions. The 'glmnetr' package has some features and functionality that we find useful, but omits some of the functionality of 'glmnet' as well. Use of the 'glmnetr' package has many similarities to the 'glmnet' package and it is recommended that the user of 'glmnetr' first become familiar with the 'glmnet' package <>, with the "An Introduction to glmnet" and "The Relaxed Lasso" being especially helpful in this regard.

Version: 0.3-1
Depends: R (≥ 3.4.0)
Imports: glmnet, survival, Matrix, rpart, xgboost, smoof, mlrMBO, ParamHelpers, torch
Suggests: R.rsp
Published: 2023-08-10
Author: Walter K Kremers ORCID iD [aut, cre], Nicholas B Larson [ctb]
Maintainer: Walter K Kremers < at>
License: GPL-3
Copyright: Mayo Foundation for Medical Education and Research
NeedsCompilation: no
CRAN checks: glmnetr results


Reference manual: glmnetr.pdf
Vignettes: Using ann_tab_cv
Using glmnetr
Using stepreg


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


Please use the canonical form to link to this page.