Skip to main content

Python wrapper for glmnet

Project description

This is a maintained fork of civisanalytics/python-glmnet, which was archived in 2024. The original package on PyPI (glmnet) can no longer be installed with modern Python toolchains due to build system issues.

Changes from the original

This fork applies minimal fixes to restore installability:

  • Fixed invalid python_requires specifier (>=3.6.*>=3.6)

  • Added pyproject.toml with proper build dependencies (setuptools<60, numpy<2) to support pip build isolation

No changes were made to the library code itself. All credit goes to the original authors at Civis Analytics.

Installation

pip install python-glmnet-fix

A Fortran compiler is required for building from source. For Mac users, brew install gcc will take care of this requirement.

Usage

The import name remains glmnet, same as the original:

from glmnet import LogitNet, ElasticNet

# Regularized Logistic Regression
m = LogitNet()
m = m.fit(x, y)
p = m.predict_proba(x)

# Regularized Linear Regression
m = ElasticNet()
m = m.fit(x, y)
p = m.predict(x)

The API follows the conventions of Scikit-Learn, so it is expected to work with tools from that ecosystem. Both models accept dense or sparse arrays.

Dependencies

  • numpy

  • scikit-learn

  • scipy

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python_glmnet_fix-2.2.2.tar.gz (89.0 kB view details)

Uploaded Source

File details

Details for the file python_glmnet_fix-2.2.2.tar.gz.

File metadata

  • Download URL: python_glmnet_fix-2.2.2.tar.gz
  • Upload date:
  • Size: 89.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for python_glmnet_fix-2.2.2.tar.gz
Algorithm Hash digest
SHA256 cef75a104898100a3440bc8a35fac4517030f051090a368eaff31799456fb71f
MD5 67e0675b845f13c96ef3a6d53a9b86b7
BLAKE2b-256 1ae80f4a45e8cb52f9536937a6be69129fb86997a8521c03611d8419eb374e38

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page