Lasso and Elastic-Net Regularized Generalized Linear Models
Overview
Extremely efficient procedures for fitting the entire lasso or elastic-net regularization path for linear regression, logistic and multinomial regression models, Poisson regression, Cox model, multiple-response Gaussian, and the grouped multinomial regression; see doi:10.18637/jss.v033.i01 and doi:10.18637/jss.v039.i05. There are two new and important additions. The family argument can be a GLM family object, which opens the door to any programmed family (doi:10.18637/jss.v106.i01). This comes with a modest computational cost, so when the built-in families suffice, they should be used instead. The other novelty is the relax option, which refits each of the active sets in the path unpenalized. The algorithm uses cyclical coordinate descent in a path-wise fashion, as described in the papers cited.
Allow for the penalty.factor argument to be a function, as it is for exclude.
Allows for seemless CV, when this function can depend on the response.
From NEWS.md in the release
Install
Health
- OK13 OK2026-10-15
- ERROR12 OK, 1 ERROR2026-10-01
- NOTE8 OK, 5 NOTE2026-09-24
- ERROR7 OK, 5 NOTE, 1 ERROR2026-09-11
- NOTE11 OK, 2 NOTE2026-07-16
Show 6 earlier changesHide 6 earlier changes
- OK13 OK2026-06-09
- ERROR12 OK, 1 ERROR2026-06-08
- OK13 OK2026-05-02
- NOTE11 OK, 1 NOTE2026-04-25
- ERROR9 OK, 4 NOTE, 1 ERROR2026-03-30
- NOTE12 OK, 2 NOTE2026-03-10
Documentation
- Help pages
- 47 (2 internal)includes a package overview page
- Examples that run
- 100%24 run in a plain check
- Exported functions with examples
- 81%
- Documented parameters
- 79%
- Return-value docs
- 75%
- Help pages citing references
- 23%
Downloads
Dependencies
Installing glmnet adds 5 packages (2 with compiled code, 4.5 MB of source tarballs). Heaviest: Rcpp 1.8 MB, RcppEigen 1.7 MB, shape 631 KB.
Show the 48 most downloaded dependentsHide the 48 most downloaded dependents
and 400 more dependents and 188 packages that suggest it on CRAN ↗
Code & Tests
Datasets
People & History
Pick two releases to compare their code metrics.
- 5.1Latest
- 5.02026-05-04 · diff ↗
- RR 4.6.0 released · 2026-04-24
- 4.1-102025-07-17 · diff ↗
- 4.1-92025-06-02 · diff ↗
- RR 4.5.0 released · 2025-04-11
- RR 4.4.0 released · 2024-04-24
- 4.1-82023-08-22 · diff ↗
- RR 4.3.0 released · 2023-04-21
- 4.1-72023-03-23 · diff ↗
- 4.1-62022-11-27 · diff ↗
- RR 4.2.0 released · 2022-04-22
- 4.1-42022-04-15 · diff ↗
- 4.1-32021-11-02 · diff ↗
- 4.1-22021-06-24 · diff ↗
- RR 4.1.0 released · 2021-05-18
Show 75 earlier eventsHide 75 earlier events
- 4.1-12021-02-21 · diff ↗
- 4.1
- 4.0-2
- 4.0
- RR 4.0.0 released · 2020-04-24
- 3.0-22019-12-11 · diff ↗
- RR 3.6.0 released · 2019-04-26
- RR 3.5.0 released · 2018-04-23
- RR 3.4.0 released · 2017-04-21
- RR 3.3.0 released · 2016-05-03
- RR 3.2.0 released · 2015-04-16
- RR 3.1.0 released · 2014-04-10
- 3.0.22013-08-01 · diff ↗
- 3.0-12019-11-15 · diff ↗
- 3.02019-11-09 · diff ↗ ·
removed 46 exports
print.glmnet, plot.glmnet, plot.multnet, plot.mrelnet, coef.cv.glmnet, predict.cv.glmnet, plot.cv.glmnet, deviance.glmnet, cv.elnet, cv.lognet, cv.multnet, cv.fishnet, cv.coxnet, cv.mrelnet, getmin, auc, auc.mat, cvcompute, cvtype, lambda.interp, response.coxnet, glmnet_softmax, na.mean, predict.elnet, predict.lognet, predict.fishnet, mrelnet, predict.multnet, predict.coxnet, predict.mrelnet and 16 moreadded 16 exports
Cindex, assess.glmnet, bigGlm, buildPredmat, coef.relaxed, confusion.glmnet, coxgrad, glmnet.measures, makeX, na.replace, na_sparse_fix, predict.relaxed, prepareX, print.cv.glmnet, relax.glmnet, roc.glmnet - RR 3.0.0 released · 2013-04-03
- 2.15.32013-03-01 · diff ↗
- 2.15.22012-10-01 · diff ↗
- 2.15.12012-04-26 · diff ↗
- RR 2.15.0 released · 2012-03-30
- 2.14.2
- RR 2.14.0 released · 2011-10-31
- 2.13.12011-06-21 · diff ↗
- RR 2.13.0 released · 2011-04-13
- 2.12.22011-02-17 · diff ↗
- 2.12.12010-11-17 · diff ↗
- RR 2.12.0 released · 2010-10-15
- 2.12.02010-06-14 · diff ↗
- 2.11.02010-04-22 · diff ↗
- RR 2.11.0 released · 2010-04-22
- RR 2.10.0 released · 2009-10-26
- RR 2.9.0 released · 2009-04-17
- 2.10.02009-01-22 · diff ↗
- 2.8.12008-12-22 · diff ↗
- RR 2.8.0 released · 2008-10-20
- 2.7.12008-06-03 · diff ↗
- 2.0-182019-05-20 · diff ↗
- 2.0-16
- 2.0-132017-09-22 · diff ↗
- 2.0-12
- 2.0-102017-05-06 · diff ↗
- 2.0-92017-05-02 · diff ↗
- 2.0-82017-04-30 · diff ↗
- 2.0-52016-03-17 · diff ↗
- 2.0-42016-03-13 · diff ↗
- 2.0-32016-02-23 · diff ↗
- 2.0-22015-04-12 · diff ↗
- 2.0-12015-04-08 · diff ↗ ·
added 10 exports
print.glmnet, plot.glmnet, plot.multnet, plot.mrelnet, predict.glmnet, coef.glmnet, coef.cv.glmnet, predict.cv.glmnet, plot.cv.glmnet, deviance.glmnet - 1.9-82014-05-24 · diff ↗
- 1.9-52013-08-04 · diff ↗
- 1.9-32013-03-02 · diff ↗
- 1.9-1
- 1.8-52013-01-04 · diff ↗
- 1.8-42012-12-27 · diff ↗
- 1.8-22012-10-02 · diff ↗
- 1.8
- 1.7.42012-04-27 · diff ↗
- 1.7.32012-02-19 · diff ↗
- 1.7.12011-09-23 · diff ↗
- 1.7
- 1.62011-04-24 · diff ↗
- 1.5.32011-03-01 · diff ↗
- 1.5.22011-02-07 · diff ↗
- 1.5.12010-11-19 · diff ↗
- 1.52010-11-04 · diff ↗
- 1.42010-06-16 · diff ↗
- 1.32010-04-25 · diff ↗
- 1.22010-04-04 · diff ↗ ·
added 26 exports
cv.elnet, cv.lognet, cv.multnet, cv.fishnet, cv.coxnet, getmin, auc, auc.mat, cvcompute, coxnet.deviance, lambda.interp, response.coxnet, rmult, softmax, predict.fishnet, predict.coxnet, jerr.elnet, jerr.lognet, jerr.fishnet, jerr.coxnet, elnet, lognet, fishnet, coxnet, getcoef, getcoef.multinomial - 1.1-52010-01-31 · diff ↗
- 1.1-42009-12-18 · diff ↗ ·
removed 4 exports
print.glmnet, predict.glmnet, plot.glmnet, coef.glmnetadded 1 export
cv.glmnet - 1.1-32009-01-24 · diff ↗
- 1.1-22008-12-23 · diff ↗
- 1.1-12008-06-27 · diff ↗
- 1.12008-06-02
- RR 2.7.0 released · 2008-04-22
Package metadata
- First published
- 2008-06-02
- Total releases
- 68 / 18 yrs
- License
- GPL-2 OSI
- Minimum R
- ≥ 3.6.0
- Bundled data
- 489 KB / 8 files
- Download size
- 2.7 MB
Cite
Cite this package
Run in R for the authors' entry:
citation("glmnet")The package provides a citation file, so citation() returns the authors' own entry.
It points to 10.18637/jss.v033.i01, 10.18637/jss.v039.i05, 10.18637/jss.v106.i01.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-21, which the citation names so these numbers can be found later. More on citing and the projects behind them.