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.
Original repository: https://github.com/civisanalytics/python-glmnet (archived)
Fork repository: https://github.com/randrover/python-glmnet
License: GPLv2 (same as original)
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cabce56b39dc04462aab4726e6498c20266f8f2bf5e0264a5f470cd493b9d5f0
|
|
| MD5 |
73de571b319ce11acff68c01b99711b6
|
|
| BLAKE2b-256 |
cde322f7d5400a2e64214b2843f6bcdc708d5fd7d66fcf93c81088bae39161e2
|