Skip to content

glmnet

Lasso and Elastic-Net Regularized Generalized Linear Models

v5.0 · May 3, 2026 · GPL-2

Description

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.

Downloads

CRAN

155.5K

Last 30 days

272nd

508.7K

Last 90 days

2.3M

Last year

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

r2u CRAN

3.9K

Last 30 days

7.4K

Last 90 days

18.5K

Last year

Trend: +140.2% (30d vs prior 30d)

autoCRAN

20

Last 7 days

140

Last 30 days

0

All-time

⚠ Shared name: this package is also shipped elsewhere on openSUSE, so this count is not exclusive to autoCRAN (it is an upper bound).

CRAN Check Status

13 OK
Show all 13 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-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 13 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Jun 9, 2026
ERROR 12 OK · 0 NOTE · 0 WARNING · 1 ERROR · 0 FAILURE Jun 8, 2026
ERROR r-devel-linux-x86_64-debian-gcc

re-building of vignette outputs

Error(s) in re-building vignettes:
  ...
--- re-building ‘Coxnet.Rmd’ using rmarkdown
--- finished re-building ‘Coxnet.Rmd’

--- re-building ‘coxdev.Rmd’ using rmarkdown
--- finished re-building ‘coxdev.Rmd’

--- re-building ‘glmnet-history.Rmd’ usin
...[truncated]...
t.Rmd’

Fatal error: cannot create 'R_TempDir'
--- re-building ‘relax.Rmd’ using rmarkdown
--- finished re-building ‘relax.Rmd’

SUMMARY: processing the following file failed:
  ‘glmnetFamily.Rmd’

Error: Vignette re-building failed.
Execution halted
OK 13 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE May 2, 2026
NOTE 11 OK · 1 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Apr 25, 2026
NOTE r-release-macos-x86_64

compiled code

File ‘glmnet/libs/glmnet.so’:
  Found non-API call to R: ‘R_UnboundValue’

Compiled code should not call non-API entry points in R.

See ‘Writing portable packages’ in the ‘Writing R Extensions’ manual,
and section ‘Moving into C API compliance’ for issues with the use of
non-API entry points.
ERROR 9 OK · 4 NOTE · 0 WARNING · 1 ERROR · 0 FAILURE Mar 30, 2026
NOTE r-devel-linux-x86_64-debian-gcc

compiled code

File ‘glmnet/libs/glmnet.so’:
  Found non-API call to R: ‘R_UnboundValue’

Compiled code should not call non-API entry points in R.

See ‘Writing portable packages’ in the ‘Writing R Extensions’ manual,
and section ‘Moving into C API compliance’ for issues with the use of
non-API entry points.
NOTE r-devel-linux-x86_64-fedora-clang

compiled code

File ‘glmnet/libs/glmnet.so’:
  Found non-API call to R: ‘R_UnboundValue’

Compiled code should not call non-API entry points in R.

See ‘Writing portable packages’ in the ‘Writing R Extensions’ manual,
and section ‘Moving into C API compliance’ for issues with the use of
non-API entry points.
NOTE r-oldrel-macos-arm64

installed package size

installed size is 33.9Mb
  sub-directories of 1Mb or more:
    libs  31.9Mb
NOTE r-oldrel-macos-x86_64

installed package size

installed size is 35.5Mb
  sub-directories of 1Mb or more:
    libs  33.6Mb
ERROR r-oldrel-windows-x86_64

re-building of vignette outputs

Error(s) in re-building vignettes:
--- re-building 'Coxnet.Rmd' using rmarkdown
! Package pdftex.def Error: File `25f5321870be33d7b7d4f5c6b4cc241bf6e3466b.pdf'
 not found: using draft setting.

Error: processing vignette 'Coxnet.Rmd' failed with diag
...[truncated]...
ging for debugging tips. See relax.log for more info.
--- failed re-building 'relax.Rmd'

SUMMARY: processing the following files failed:
  'Coxnet.Rmd' 'glmnet.Rmd' 'glmnetFamily.Rmd' 'relax.Rmd'

Error: Vignette re-building failed.
Execution halted
NOTE 12 OK · 2 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Mar 10, 2026
NOTE r-oldrel-macos-arm64

installed package size

installed size is 33.9Mb
  sub-directories of 1Mb or more:
    libs  31.9Mb
NOTE r-oldrel-macos-x86_64

installed package size

installed size is 35.5Mb
  sub-directories of 1Mb or more:
    libs  33.6Mb

Reverse Dependencies (601)

imports

ARGOS ARTtransfer AnchorRegression ArCo BNrich BSPBSS BWGS BeSS BioUtils BlockMissingData BrainCon CARBayes CERFIT CICI CIpostSelect CNVreg CRE CSCNet CausalMetaR CenBAR ComICS Compositional CondCopulas ConformalSmallest ConnectednessApproach Coxmos DDL DEET DLL DLMRMV DMRnet DevTreatRules E2E EMJMCMC ENMeval ER EZtune EpidigiR FADA FGLMtrunc FLAME FLORAL FastRet FindIt FluxPoint FunctanSNP GEInfo GMDH2 GMSimpute GRSxE GWLelast GWRLASSO GWlasso HMC HOIFCar HTLR HTRX ICBioMark IOBR IsingFit KnockoffHybrid LEGIT LKT LRQVB LUCIDus LassoSIR MESS MFF MLSP MRFA MRZero MTE MUGS MUVR2 MaximinInfer MedZIsc MendelianRandomization MetaNLP MetabolicSurv MicrobiomeSurv MissCP NCutYX NeighborFinder NetGreg NetSurvProx NonProbEst ODRF OHPL OpenSpecy PCGII PDN PFLR PRISM.forecast PheCAP PheVis PhylogeneticEM ProxReg QTL.gCIMapping QTL.gCIMapping.GUI Qval RBBR REN RISCA RNAseqNet ROCSI RPtests RSDA RTextTools RaSEn RegEnRF RegrCoeffsExplorer Rforestry Ricrt RobustIV RobustPrediction Robyn S3VS SAVER SBICgraph SEMgraph SIHR SILFS SILM SIS SISIR SMAHP SMLE SMMAL SOIL SPSP SQIpro STOPES SVEMnet SelectBoost SelectBoost.beta SentimentAnalysis ShiVa Sieve SoftBart SpTe2M SplitKnockoff StabilizedRegression StratifiedMedicine SuRF.vs SubgrpID SurvGME SurvHiDim TANDEM TOSI TRexSelector TULIP TensorMCMC TraceAssist TransHDM VARcpDetectOnline VSOLassoBag WLogit WpProj ZVCV afthd aglm alookr aloom amp anoint argo arulesCBA auxvecLASSO banditsCI bbknnR bestglm betaStability biospear bolasso bonsaiforest c060 caretMultimodal categoryEncodings causalweight cbl changepoints clusterMI coda4microbiome combss comets conformalInference.multi cornet cossonet cpfa cpt cramR crossurr csmpv customizedTraining ddml debiasedTrialEmulation difR dipw dnr doc2concrete drcarlate drrglm dtComb ePCR easy.glmnet emBayes enetLTS eshrink evalITR eventstream factReg fairml fastcpd fbrglm fetwfe finnts flassomsm flexBART forestsearch funcml fuser gapclosing ggmix glmnetSE glmnetUtils glmnetr glmtrans gofar goffda graphicalExtremes graphicalVAR hal9001 hbal hdcuremodels hdi hdm hdme hdnom highMLR icomb idopNetwork inet interflex inters intrinsicFRP ivgls joinet khaos knockoff kosel kuenm2 kumquat l1spectral lilikoi lime localModel logicDT manydata mase matrans maxnet mcb mcboost mdpeer metafuse mgm mice mikropml milr mimar misaem misspi mlS3 mlr3superlearner modelSelection modeltime.ensemble modnets mombf mplot msaenet mudfold multiModTest multid multiness multivar multiview mvfmr nadir naivereg natural netgsa nnGarrote nnfor nproc oCELLoc oRaklE obliqueRSF ocf ocrRBBR omicwas oncoPredict organik pacheck palasso pboost pda pencal penppml pgraph phd plasso plmmr plsmmLasso plsmselect poissonsuperlearner politeness polywog pqrBayes pre precmed predhy predhy.GUI predictoR priorityelasticnet prioritylasso probe pye quanteda.textmodels quickSentiment rENA rMultiNet rare rdomains regmhmm regnet regressoR regtools riskRegression rminer robStepSplitReg roben roseRF rrpack sMTL savvyGLM savvyPR savvySh sccic sdafilter sentometrics sharp simode simputation sivs skipTrack smurf spareg sparselink sparsevar sparsevb spexvb spinBayes splitSelect spm2 squant stabiliser stacks starnet stepPenal stm sts sureLDA survalis survcompare survivalSL svyVarSel tehtuner theftdlc tidylearn tools4uplift traineR transfR transreg tsensembler tsrobprep varEst varGuid varGuidTS varPro varycoef waou webSDM wsprv xLLiM xrf

suggests

Dependency Network

Dependencies Reverse dependencies Matrix foreach shape survival Rcpp CBPS DTRlearn2 GlarmaVarSel Grace HIMA InvariantCausalPrediction KLexp LogisticEnsembles MNS MRFcov MTPS MultiGlarmaVarSel NBtsVarSel NumericEnsembles PAS +586 more reverse deps glmnet

Version History

55 tracked
updated 5.0 ← 4.1-10 diff May 4, 2026
new 4.1-10 Mar 10, 2026
updated 4.1-10 ← 4.1-9 diff Jul 16, 2025
updated 4.1-9 ← 4.1-8 diff Jun 1, 2025
updated 4.1-8 ← 4.1-7 diff Aug 21, 2023
updated 4.1-7 ← 4.1-6 diff Mar 22, 2023
updated 4.1-6 ← 4.1-4 diff Nov 26, 2022
updated 4.1-4 ← 4.1-3 diff Apr 14, 2022
updated 4.1-3 ← 4.1-2 diff Nov 1, 2021
updated 4.1-2 ← 4.1-1 diff Jun 23, 2021
updated 4.1-1 ← 4.1 diff Feb 20, 2021
updated 4.1 ← 4.0-2 diff Jan 10, 2021
updated 4.0-2 ← 4.0 diff Jun 15, 2020
updated 4.0 ← 3.0-2 diff May 13, 2020
updated 3.0-2 ← 3.0-1 diff Dec 10, 2019