SKLearn Linear Model Modification
This class should act exactly like sklearn linear model to solve regression problems with the benefit of being able to use drop1 and add1 based on AIC.
Installation
Run the following to install:
pip install sklearn_linear_model_modification
Usage
import pandas as pd
from sklearn_linear_model_modification import LinearRegression, Add1LinearRegression, Drop1LinearRegression
from sklearn_linear_model_modification import Lasso, Add1Lasso, Drop1Lasso
from sklearn_linear_model_modification import ElasticNet, Add1ElasticNet, Drop1ElasticNet
from sklearn_linear_model_modification import Ridge, Add1Ridge, Drop1Ridge
def load_Xy():
data = load_boston()
X = pd.DataFrame( data['data'], columns=data['feature_names'] )
y = data['target']
return X, y
X, y = load_Xy()
lmod = Ridge()
lmod.fit(X, y)
lmod = Lasso()
lmod.fit(X, y)
lmod = ElasticNet()
lmod.fit(X, y)
lmod = LinearRegression()
lmod.fit(X, y)
lmod = Add1Ridge()
lmod.fit(X, y)
lmod = Add1Lasso()
lmod.fit(X, y)
lmod = Add1ElasticNet()
lmod.fit(X, y)
lmod = Add1LinearRegression()
lmod.fit(X, y)
lmod = Drop1Ridge()
lmod.fit(X, y)
lmod = Drop1Lasso()
lmod.fit(X, y)
lmod = Drop1ElasticNet()
lmod.fit(X, y)
lmod = Drop1LinearRegression()
lmod.fit(X, y)
Development sklearn_linear_model_modification
To install sklearn_linear_model_modification, along with the tools you need to develop and run tests, run the following in your virtualend:
$ pip install -e .[dev]
Metadata
Release files for sklearn-linear-model-modification 0.0.11
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| sklearn_linear_model_modification-0.0.11.tar.gz | 5.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sklearn_linear_model_modification-0.0.11-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.9 kB
Release files / sklearn_linear_model_modification-0.0.11.tar.gz
| Download URL | sklearn_linear_model_modification-0.0.11.tar.gz |
|---|---|
| Size | 5.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
842f7cbbf503656164ff179d012eed2f3427bf5acddc5c6b34255c2a735d3f9f
|
|
BLAKE2b-256 checksum How to use checksums |
6e1172735175183daf5eaf4817b61ba2f2b28163117f9f329159865b0677822b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/3.10.0 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8
|
Release files / sklearn_linear_model_modification-0.0.11-py3-none-any.whl
| Download URL | sklearn_linear_model_modification-0.0.11-py3-none-any.whl |
|---|---|
| Size | 7.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4440a0a10958c250fb76e2908e5852302b4ad1350222293de6aba7165e5b428e
|
|
BLAKE2b-256 checksum How to use checksums |
cf7f12a2e3638966658dfe7e8066d443811d502e4b0e8124f2032454c6e8cde0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/3.10.0 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8
|