{
  "name": "Lasso logistic regression settings in glmnet (R) and scikit-learn (Python)",
  "description": "Side-by-side comparison of how the two packages express a lasso logistic regression: the argument that selects the pure L1 penalty, the penalty-strength parameter and its direction, and the algorithm or solvers. Compiled by CASRAI from the glmnet vignette, the cv.glmnet reference, the glmnet JSS paper and the scikit-learn documentation.",
  "page": "https://casrai.org/guides/lasso-logistic-regression",
  "publisher": "CASRAI",
  "license": "https://creativecommons.org/licenses/by/4.0/",
  "dateModified": "2026-11-18T20:47:01Z",
  "temporalCoverage": null,
  "spatialCoverage": null,
  "columns": [
    {
      "name": "Aspect",
      "unit": "",
      "description": ""
    },
    {
      "name": "glmnet (R)",
      "unit": "",
      "description": ""
    },
    {
      "name": "scikit-learn (Python)",
      "unit": "",
      "description": ""
    }
  ],
  "rows": [
    {
      "Aspect": "Argument that gives the pure lasso",
      "glmnet (R)": "alpha = 1 (the default)",
      "scikit-learn (Python)": "l1_ratio = 1"
    },
    {
      "Aspect": "Penalty-strength parameter",
      "glmnet (R)": "lambda: larger means stronger penalty",
      "scikit-learn (Python)": "C: inverse strength, smaller means stronger penalty"
    },
    {
      "Aspect": "Algorithm or solvers for the L1 penalty",
      "glmnet (R)": "Coordinate descent (Friedman, Hastie and Tibshirani 2010)",
      "scikit-learn (Python)": "liblinear or saga (lbfgs, newton-cg, newton-cholesky and sag do not support L1)"
    }
  ],
  "sources": [
    {
      "title": "glmnet vignette",
      "url": "https://glmnet.stanford.edu/articles/glmnet.html",
      "accessed": "2026-11-18"
    },
    {
      "title": "glmnet reference: cv.glmnet",
      "url": "https://glmnet.stanford.edu/reference/cv.glmnet.html",
      "accessed": "2026-11-18"
    },
    {
      "title": "Regularization Paths for Generalized Linear Models via Coordinate Descent",
      "url": "https://www.jstatsoft.org/article/view/v033i01",
      "accessed": "2026-11-18"
    },
    {
      "title": "scikit-learn Linear Models",
      "url": "https://scikit-learn.org/stable/modules/linear_model.html",
      "accessed": "2026-11-18"
    }
  ]
}