Skip to content

glmnetr

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

v0.6-3 · Dec 16, 2025 · GPL-3

Description

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. Note, at the time of this writing, in order to fit gradient boosting machine models one must install the packages 'DiceKriging' and 'rgenoud' using the install.packages() function. 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, making it difficult to get solutions from either glmnet() or cv.glmnet(). This may be remedied by using the 'path=TRUE' option when calling glmnet() and cv.glmnet(). Within the 'glmnetr' package the approach of path=TRUE is taken by default. 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.

Downloads

840

Last 30 days

4248th

2.5K

Last 90 days

9.4K

Last year

Trend: -10.3% (30d vs prior 30d)

CRAN Check Status

14 OK
Show all 14 flavors
Flavor Status
r-devel-linux-x86_64-debian-clang OK
r-devel-linux-x86_64-debian-gcc OK
r-devel-linux-x86_64-fedora-clang OK
r-devel-linux-x86_64-fedora-gcc OK
r-devel-macos-arm64 OK
r-devel-windows-x86_64 OK
r-oldrel-macos-arm64 OK
r-oldrel-macos-x86_64 OK
r-oldrel-windows-x86_64 OK
r-patched-linux-x86_64 OK
r-release-linux-x86_64 OK
r-release-macos-arm64 OK
r-release-macos-x86_64 OK
r-release-windows-x86_64 OK

Check History

OK 14 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Mar 10, 2026

Dependency Network

Dependencies Reverse dependencies glmnet survival Matrix xgboost smoof mlrMBO ParamHelpers randomForestSRC rpart torch aorsf glmnetr

Version History

new 0.6-3 Mar 10, 2026
updated 0.6-3 ← 0.6-2 diff Dec 15, 2025
updated 0.6-2 ← 0.6-1 diff Aug 18, 2025
updated 0.6-1 ← 0.5-5 diff May 9, 2025
updated 0.5-5 ← 0.5-4 diff Jan 16, 2025
updated 0.5-4 ← 0.5-3 diff Oct 23, 2024
updated 0.5-3 ← 0.5-2 diff Aug 27, 2024
updated 0.5-2 ← 0.5-1 diff Jul 11, 2024
updated 0.5-1 ← 0.4-6 diff May 11, 2024
updated 0.4-6 ← 0.4-5 diff Apr 20, 2024
updated 0.4-5 ← 0.4-4 diff Apr 19, 2024
updated 0.4-4 ← 0.4-3 diff Mar 22, 2024
updated 0.4-3 ← 0.4-2 diff Mar 3, 2024
updated 0.4-2 ← 0.4-1 diff Feb 8, 2024
updated 0.4-1 ← 0.3-1 diff Jan 8, 2024
updated 0.3-1 ← 0.2-1 diff Aug 9, 2023
updated 0.2-1 ← 0.2-0 diff Jun 6, 2023
updated 0.2-0 ← 0.1-2 diff May 9, 2023
updated 0.1-2 ← 0.1-1 diff Feb 17, 2023
new 0.1-1 Dec 13, 2022