Skip to main content

A binomial classifier based on glmnet

Project description

CircleCI

GlmnetClassifier

A binomial classifier based on glmnet.

Contact

Rolf Carlson hrolfrc@gmail.com

Install

Use pip to install glmnet-classifier.

pip install glmnet-classifier

Introduction

The glmnet-classifier project provides GlmnetClassifier for the classification and prediction for two classes, the binomial case. GlmnetClassifier is based on glmnet. A fortran compiler is required.

GlmnetClassifier is designed for use with scikit-learn pipelines and composite estimators.

Example

from glmnet_classifier import GlmnetClassifier
from sklearn.datasets import make_classification
from sklearn.model_selection import train_test_split
Make a classification problem
seed = 42
X, y = make_classification(
    n_samples=30,
    n_features=5,
    n_informative=2,
    n_redundant=2,
    n_classes=2,
    random_state=seed
)
X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=seed)
Train the classifier
cls = GlmnetClassifier().fit(X_train, y_train)
Get the score on unseen data
cls.score(X_test, y_test)
1.0

Authors

The authors of glmnet are Jerome Friedman, Trevor Hastie, Rob Tibshirani and Noah Simon. The Python package, glmnet_py, is maintained by B. J. Balakumar.

The glmnet-classifier package was written by Rolf Carlson, as an adaptation of glmnet_py.

References

References Jerome Friedman, Trevor Hastie and Rob Tibshirani. (2008). Regularization Paths for Generalized Linear Models via Coordinate Descent Journal of Statistical Software, Vol. 33(1), 1-22 Feb 2010.

Noah Simon, Jerome Friedman, Trevor Hastie and Rob Tibshirani. (2011). Regularization Paths for Cox’s Proportional Hazards Model via Coordinate Descent Journal of Statistical Software, Vol. 39(5) 1-13.

Robert Tibshirani, Jacob Bien, Jerome Friedman, Trevor Hastie, Noah Simon, Jonathan Taylor, Ryan J. Tibshirani. (2010). Strong Rules for Discarding Predictors in Lasso-type Problems Journal of the Royal Statistical Society: Series B (Statistical Methodology), 74(2), 245-266.

Noah Simon, Jerome Friedman and Trevor Hastie (2013). A Blockwise Descent Algorithm for Group-penalized Multiresponse and Multinomial Regression

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

glmnet-classifier-0.1.44.tar.gz (162.2 kB view details)

Uploaded Source

Built Distribution

glmnet_classifier-0.1.44-py3-none-any.whl (182.3 kB view details)

Uploaded Python 3

File details

Details for the file glmnet-classifier-0.1.44.tar.gz.

File metadata

  • Download URL: glmnet-classifier-0.1.44.tar.gz
  • Upload date:
  • Size: 162.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for glmnet-classifier-0.1.44.tar.gz
Algorithm Hash digest
SHA256 02e970db059c20109470a41a5211214d00abe9beb1176e3c1db3160883357f62
MD5 34db7b6ba8bf5339a0496fcbf8d383f8
BLAKE2b-256 c9bccfe74eca3a8718aef21326789a38314c3915e0a289db220cc10f577fb322

See more details on using hashes here.

File details

Details for the file glmnet_classifier-0.1.44-py3-none-any.whl.

File metadata

File hashes

Hashes for glmnet_classifier-0.1.44-py3-none-any.whl
Algorithm Hash digest
SHA256 d801af04ffeda2025e7a22f11b0ab87dfe23277d19daed5004ed1bb65f2af916
MD5 8ae39f58370983734531369117b31f1f
BLAKE2b-256 751562b388b1e1cdd28090f038f217ab5393f08b490367c5b62eed7a033d2feb

See more details on using hashes here.

Supported by

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