Skip to content

glmnet

Lasso and Elastic-Net Regularized Generalized Linear Models

v4.1-10 · Jul 16, 2025 · 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

150.5K

Last 30 days

282nd

478.7K

Last 90 days

2.2M

Last year

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

CRAN Check Status

1 ERROR
6 NOTE
7 OK
Show all 14 flavors
Flavor Status
r-devel-linux-x86_64-debian-clang NOTE
r-devel-linux-x86_64-debian-gcc NOTE
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 NOTE
r-oldrel-macos-arm64 NOTE
r-oldrel-macos-x86_64 NOTE
r-oldrel-windows-x86_64 ERROR
r-patched-linux-x86_64 NOTE
r-release-linux-x86_64 OK
r-release-macos-arm64 OK
r-release-macos-x86_64 OK
r-release-windows-x86_64 OK
Check details (7 non-OK)
NOTE r-devel-linux-x86_64-debian-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-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-windows-x86_64

compiled code

File 'glmnet/libs/x64/glmnet.dll':
  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 diagnostics:
LaTeX failed to compile D:/RCompile/CRANpkg/local/4.4/glmnet.Rcheck/vign_test/glmnet/vignettes/Coxnet.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See Coxnet.log for more info.
--- failed re-building 'Coxnet.Rmd'

--- re-building 'glmnet.Rmd' using rmarkdown
! Package pdftex.def Error: File `7b1f18dee03b8db953d29648bd152e578f83d189.pdf'
 not found: using draft setting.

Error: processing vignette 'glmnet.Rmd' failed with diagnostics:
LaTeX failed to compile D:/RCompile/CRANpkg/local/4.4/glmnet.Rcheck/vign_test/glmnet/vignettes/glmnet.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See glmnet.log for more info.
--- failed re-building 'glmnet.Rmd'

--- re-building 'glmnetFamily.Rmd' using rm
...[truncated]...
96ad59121a1121ba73.png'
 not found: using draft setting.

Error: processing vignette 'glmnetFamily.Rmd' failed with diagnostics:
LaTeX failed to compile D:/RCompile/CRANpkg/local/4.4/glmnet.Rcheck/vign_test/glmnet/vignettes/glmnetFamily.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See glmnetFamily.log for more info.
--- failed re-building 'glmnetFamily.Rmd'

--- re-building 'relax.Rmd' using rmarkdown
! Package pdftex.def Error: File `7957f5b5ba07fd52cd1e9116b04e015ece34e133.pdf'
 not found: using draft setting.

Error: processing vignette 'relax.Rmd' failed with diagnostics:
LaTeX failed to compile D:/RCompile/CRANpkg/local/4.4/glmnet.Rcheck/vign_test/glmnet/vignettes/relax.tex. See https://yihui.org/tinytex/r/#debugging 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 r-patched-linux-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.

Check History

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 (572)

imports

ARGOS ARTtransfer AnchorRegression ArCo BNrich BSPBSS BWGS BeSS 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 HCTR HDCI HMC HOIFCar HTLR HTRX ICBioMark IsingFit KnockoffHybrid LEGIT LKT LPRelevance LRQVB LUCIDus LassoSIR MESS MFF MLSP MRFA MRZero MTE MUGS MUVR2 MaximinInfer MedZIsc MendelianRandomization MetaNLP MetabolicSurv MicrobiomeSurv MissCP NCutYX NetGreg 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 RobMixReg RobustIV RobustPrediction Robyn S3VS SAVER SBICgraph SEMgraph SIHR SILFS SILM SIS SISIR SMAHP SMLE SMMAL SOIL SPSP 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 bgsmtr biospear bolasso bonsaiforest c060 categoryEncodings causalweight cbl changepoints clusterMI coca coda4microbiome comets conformalInference.multi cornet cossonet cpfa cpt cramR crossurr csmpv customizedTraining ddml debiasedTrialEmulation difR dipw dlbayes dnr doc2concrete drcarlate dtComb ePCR easy.glmnet emBayes enetLTS eshrink evalITR eventstream expandFunctions factReg fairml fastcpd fetwfe finnts flassomsm flexBART forestsearch fuser gamlss.foreach gamreg ggmix glmnetSE glmnetUtils glmnetr glmtrans gofar goffda graphicalExtremes graphicalVAR hal9001 hbal hdcuremodels hdi hdm hdme hdnom idopNetwork inet inters intrinsicFRP joinet knockoff kosel kuenm2 l1spectral lilikoi lime localModel logicDT manydata mase matrans maxnet mcb mcboost mdpeer metafuse mgm mice mikropml milr mimi misaem misspi mlr3superlearner modelSelection modeltime.ensemble modnets mombf mplot msaenet mudfold multiModTest multid multiness multivar multivarious multiview mvfmr nadir naivereg natural netgsa nnGarrote nnfor nonet nproc oCELLoc oRaklE obliqueRSF ocf ocrRBBR omicwas organik pacheck palasso pda pencal penppml pgraph phd plasso plmmr plsmmLasso plsmselect poissonsuperlearner politeness polywog pqrBayes pre precmed predhy predhy.GUI predictoR priorityelasticnet prioritylasso probe quanteda.textmodels quickSentiment rENA rMultiNet rare rdomains regmhmm regnet regressoR regtools relgam riskRegression rminer robStepSplitReg roben roseRF rrpack sMTL savvyPR savvySh scAnnotate scPOEM sdafilter sentometrics sharp simode simputation sivs skipTrack smurf spareg sparselink sparsereg sparsevar sparsevb spexvb spinBayes splitSelect spm2 squant stabiliser stacks starnet stepPenal stm sts sureLDA survcompare survivalSL svyVarSel tehtuner theftdlc tidylearn tools4uplift traineR transfR transreg tsensembler tsrobprep varEst varPro varycoef waou webSDM wsprv xLLiM xrf

Dependency Network

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

Version History

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
updated 3.0-1 ← 3.0 diff Nov 14, 2019
updated 3.0 ← 2.0-18 diff Nov 8, 2019
updated 2.0-18 ← 2.0-16 diff May 19, 2019
updated 2.0-16 ← 2.0-13 diff Apr 1, 2018
updated 2.0-13 ← 2.0-12 diff Sep 21, 2017
updated 2.0-12 ← 2.0-10 diff Sep 12, 2017