Changelog
glmnet 5.0 Series
CRAN release: 2026-05-04
5.2 (development)
-
cv.glmnet()now takesnzerofrom the fitted object’sdfinstead of recomputing it. For multinomial and mgaussian fits,nzerois now the number of variables with a nonzero coefficient in any class or response. Previously ungrouped multinomial fits reported the median of the per-class counts, and grouped multinomial and mgaussian fits counted the intercept as a variable.nzero(andnzero.min/nzero.1sefor relaxed fits) no longer carries names. -
predict()andcoef()on relaxed fits now accept a vector ofgammavalues, returning a list of results named bygamma. This path previously always failed (could not find function "outlist"). - The coxdev submodule moves to 0.3.0, which fixes the diagonal of the Hessian with Efron’s ties at tied failure times. It is used as the IRLS weights, so Efron fits with tied failures may take different iterations, though they converge to the same solution. It is also what
coxgrad(..., diag.hessian = TRUE)returns. - Unpenalized Cox fits (
lambda = 0) now converge when a coefficient is held atlower.limitsorupper.limits; previously the convergence check never passed in that case. - The
coxgrad()documentation now says that the"diag_hessian"attribute is the diagonal of the Hessian of the deviance, i.e. -2 times the derivative of the returned gradient, not the Hessian of the log partial likelihood.
5.1 (2026-09-23)
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.
5.0 (2026-04-27)
First release since v4.1-10 (July 2025). Major rearchitecture with Cox speedups, a new per-call algorithm-control mechanism, and two new vignettes.
Architecture
- All Fortran removed; glmnetpp and coxdev are now git submodules.
- Cox is a first-class GLM type in glmnetpp; Cox deviance handled by coxdev (stratified and unstratified).
- Cox speedups vs CRAN 4.1-10 on current hardware: ~2× dense, 5–11× sparse, 10–70× stratified. Non-Cox families unchanged and bit-identical.
Cox interface
- New
cox.ties = c("breslow", "efron"); default is"breslow"for now. Calls withfamily = "cox"that don’t setcox.tiesemit a warning — the default switches to"efron"in v5.1 to matchsurvival::coxph.
Algorithm control
- New
control = list(...)argument toglmnet()(and tocv.glmnet,glmnet.path,glmnet.fit,elnet.fit) overrides any of 17 algorithm-control parameters for a single call without mutating session state. Unknown keys error. - Top-level
thresh,maxit,dfmax,pmax,trace.itinglmnet()are deprecated; usecontrol = list(...)orglmnet.control(). -
dfmaxandpmaxsignature defaults are nowNULL, resolving at call time tonvars + 1andmin(2*dfmax + 20, nvars).
Vignettes
- New
glmnet-history.Rmd— package history, milestones, attributions. - New
coxdev.Rmd— the coxdev deviance/gradient library.
Other behavior changes
-
predict.glmnet(type = "nonzero", s = ...)now always returns a list (one slot persvalue, each slot an integer vector of active-coefficient indices). Earlier versions returned adata.framewhen the per-sindex counts happened to be uniform, and a list otherwise. This makes the return shape consistent with the no-sform and with the function’s documentation, but is a silent breaking change for callers that branched onis.data.frame()of the result. To get a stable union of indices acrosssvalues regardless of glmnet version, usesort(unique(unlist(predict(fit, type = "nonzero", s = lambda)))).
glmnet 4.1 Series
CRAN release: 2021-01-11
4.1-10 (2025-07-17)
Adjusted plotting again. Default is now using -log(lambda) as default for plotting, which is option xvar=‘lambda’. Also fixed labeling issues with predict and coef
4.1-9 (2025-06-02)
Changed default plotting xvar = “lambda”. Corrected some minor issues in citation file.
4.1-7 (2023-03-23)
Added DOI for JSS 2023 paper and corrected some typos in documentation (nfold -> nfolds) and vignette.
4.1-6 (2022-11-27)
Removed unneeded legacy fortran code, leaving only coxnet. Fixed up Matrix as() sequences
4.1-5
Relatively minor changes to bugs in survival functions and bigGlm, and some improved failure messages.
4.1-4 (2022-04-15)
Most of the Fortran code has been replaced by C++ by James Yang, leading to speedups in all cases. The exception is the Cox routine for right censored data, which is still under development.
4.1-3 (2021-11-02)
Some of the Fortran in glmnet has been replaced by C++, written by the newest member of our team, James Yang. * the wls routines (dense and sparse), that are the engines under the glmnet.path function when we use programmable families, are now written in C++, and lead to speedups of around 8x. * the family of elnet routines (sparse/dense, covariance/naive) for glmnet(...,family="gaussian") are all in C++, and lead to speedups around 4x.
4.1-2 (2021-06-24)
A new feature added, as well as some minor fixes to documentation. * The exclude argument has come to life. Users can now pass a function that can take arguments x, y and weights, or a subset of these, for filtering variables. Details in documentation and vignette. * Prediction with single newx observation failed before. This is fixed. * Labeling of predictions from cv.glmnet improved. * Fixed a bug in mortran/fortran that caused program to loop ad infinitum
4.1-1 (2021-02-21)
Fixed some bugs in the coxpath function to do with sparse X. * when some penalty factors are zero, and X is sparse, we should not call GLM to get the start * apply does not work as intended with sparse X, so we now use matrix multiplies instead in computing lambda_max * added documentation for cv.glmnet to explain implications of supplying lambda
4.1 (2021-01-11)
Expanded scope for the Cox model. * We now allow (start, stop) data in addition to the original right-censored all start at zero option. * Allow for strata as in survival::coxph * Allow for sparse X matrix with Cox models (was not available before) * Provide method for survival::survfit
Vignettes are revised and reorganized. Additional index information stored on cv.glmnet objects, and included when printed.
glmnet 4.0 Series
CRAN release: 2020-05-14
4.0-2 (2020-06-16)
- Biggest change. Cindex and auc calculations now use the
concordancefunction from packagesurvival - Minor changes. Allow coefficient warm starts for glmnet.fit. The print method for glmnet now really prints %Dev rather than the fraction.
4.0 (2020-05-14)
Major revision with added functionality. Any GLM family can be used now with glmnet, not just the built-in families. By passing a “family” object as the family argument (rather than a character string), one gets access to all families supported by glm. This development was programmed by our newest member of the glmnet team, Kenneth Tay.
glmnet 3.0 Series
CRAN release: 2019-11-09
3.0-3
Bug fixes
-
Intercept=FALSEwith “Gaussian” is fixed. Thedev.ratiocomes out correctly now. The mortran code was changed directly in 4 places. look for “standard”. Thanks to Kenneth Tay.
3.0-2 (2019-12-11)
Bug fixes
-
confusion.glmnetwas sometimes not returning a list because of apply collapsing structure -
cv.mrelnetandcv.multnetdropping dimensions inappropriately - Fix to
storePBto avoid segfault. Thanks Tomas Kalibera! - Changed the help for
assess.glmnetand cousins to be more helpful! - Changed some logic in
lambda.interpto avoid edge cases (thanks David Keplinger)
3.0 (2019-11-09)
This is a major revision with much added functionality, listed roughly in order of importance. An additional vignette called relax is supplied to describe the usage.
-
relaxargument added toglmnet. This causes the models in the path to be refit without regularization. The resulting object inherits from classglmnet, and has an additional component, itself a glmnet object, which is the relaxed fit. -
relaxargument tocv.glmnet. This allows selection from a mixture of the relaxed fit and the regular fit. The mixture is governed by an argumentgammawith a default of 5 values between 0 and 1. -
predict,coefandplotmethods forrelaxedandcv.relaxedobjects. -
printmethod forrelaxedobject, and newprintmethods forcv.glmnetandcv.relaxedobjects. - A progress bar is provided via an additional argument
trace.it=TRUEtoglmnetandcv.glmnet. This can also be set for the session viaglmnet.control. - Three new functions
assess.glmnet,roc.glmnetandconfusion.glmnetfor displaying the performance of models. -
makeXfor building thexmatrix for input toglmnet. Main functionality is one-hot-encoding of factor variables, treatment ofNAand creating sparse inputs. -
bigGlmfor fitting the GLMs ofglmnetunpenalized.
In addition to these new features, some of the code in glmnet has been tidied up, especially related to CV.
glmnet 2.0 Series
2.0-20
- Fixed a bug in internal function
coxnet.devianceto do with inputpred, as well as saturatedloglike(missing) and weights - added a
coxgradfunction for computing the gradient
2.0-16 (2018-04-02)
- Additional fixes to mortran; current mortran src is in
inst/mortran - Mortran uses double precision, and variables are initialized to avoid
-Wallwarnings - cleaned up repeat code in CV by creating a utility function
2.0-13 (2017-09-22)
- Cleaned up some bugs to do with exact prediction
-
newoffsetcreated problems all over - fixed these
2.0-7
- constant
yblows upelnet; error trap included - fixed
lambda.interpwhich was returningNaNunder degenerate circumstances.
glmnet 1.0 Series
1.9-8 (2014-05-24)
- fixed bug in multivariate response model (uninitialized variable), leading to valgrind issues
- fixed issue with multinomial response matrix and zeros
- Added a link to a glmnet vignette
1.9-6
- fixed bug in
predict.glmnet,predict.multnetandpredict.coxnet, whens=argument is used with a vector of values. It was not doing the matrix multiply correctly - changed documentation of glmnet to explain logistic response matrix
1.9-1 (2013-02-10)
- added upper and lower bounds for coefficients
- added
glmnet.controlfor setting systems parameters - fixed serious bug in
coxnet
1.8 (2012-07-03)
- Major new release
- added
mgaussianfamily for multivariate response - added
groupedoption for multinomial family
1.7-4 (2012-04-27)
- nasty bug fixed in fortran - removed reference to dble
- check class of
newxand makedgCmatrixif sparse
1.7-1 (2011-09-23)
-
lognetadded a classnames component to the object -
predict.lognet(type="class")now returns a character vector/matrix
1.6 (2011-04-24)
-
predict.glmnet: fixed bug withtype="nonzero" -
glmnet: Now x can inherit fromsparseMatrixrather than the very specificdgCMatrix, and this will trigger sparse mode for glmnet
1.5 (2010-11-04)
-
glmnet.Rd(lambda.min) : changed value to 0.01 ifnobs < nvars, (lambda) added warnings to avoid single value, (lambda.min): renamed itlambda.min.ratio -
glmnet(lambda.min) : changed value to 0.01 ifnobs < nvars(HessianExact) : changed the sense (it was wrong), (lambda.min): renamed itlambda.min.ratio. This allows it to be calledlambda.minin a call though -
predict.cv.glmnet(new function) : makes predictions directly from the savedglmnetobject on the cv object -
coef.cv.glmnet(new function) : as above -
predict.cv.glmnet.Rd: help functions for the above -
cv.glmnet: insertdrop(y)to avoid 1 column matrices; now include aglmnet.fitobject for later predictions -
nonzeroCoef: added a special case for a single variable inx; it was dying on this -
deviance.glmnet: included -
deviance.glmnet.Rd: included