A binomial classifier based on glmnet
Project description
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
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
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
Built Distribution
Hashes for glmnet_classifier-0.1.40-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 61dea1d73706ff9796bada1600bb519f7d0f93891bb4d37377691a03979edbd8 |
|
MD5 | c7df8d970765967f67597aa62c3f3b39 |
|
BLAKE2b-256 | 5c76cb663e357c9e89aca2fa7df6fe91a4e9ab960360394b5d66101222dfe9ec |