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.3.tar.gz (89.0 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: python_glmnet_fix-2.2.3.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.3.tar.gz
Algorithm Hash digest
SHA256 cabce56b39dc04462aab4726e6498c20266f8f2bf5e0264a5f470cd493b9d5f0
MD5 73de571b319ce11acff68c01b99711b6
BLAKE2b-256 cde322f7d5400a2e64214b2843f6bcdc708d5fd7d66fcf93c81088bae39161e2

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