Open source machine learning library with various models and tools
Project description
waveml
Open source machine learning library for performance of a weighted average and linear transformations over stacked predictions
Pip
pip install waveml
Overview
waveml features four models:
WaveStackingTransformer
WaveRegressor
WaveTransformer
WaveEncoder
WaveStackingTransformer
Performs Classical Stacking
Can be used for following objectives:
Regression
Classification
Probability Prediction
Usage example
from waveml import WaveStackingTransformer
from catboost import CatBoostRegressor
from xgboost import XGBRegressor
from lightgbm import LGBMRegressor
wst = WaveStackingTransformer(
models=[
("CBR", CatBoostRegressor()),
("XGBR", XGBRegressor()),
("LGBMR", LGBMRegressor())
],
n_folds=5,
verbose=True,
regression=True,
random_state=42,
shuffle=True
)
from sklearn.datasets import load_boston
form sklearn.model_selection import train_test_split
X, y = load_boston(return_X_y=True)
X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=42, shuffle=True)
SX_train = wst.fit_transform(X_train, y_train, prettified=True)
SX_test = wst.transform(X_test, prettified=True)
from sklearn.linear_model import LinearRegression
lr = LinearRegression()
lr.fit(SX_train, y_train)
lr.predict(SX_test)
Sklearn compatebility
from sklearn.pipeline import Pipeline
pipeline = Pipeline(
steps=[
("Stack_L1", wst),
("Final Estimator", lr)
]
)
pipeline.fit(X_train, y_train)
pipeline.predict(X_test)
WaveRegressor
Performs weighted average over stacked predictions
Analogue of Linear Regression without intercept
Linear Regression: y = b0 + b1x1 + b2x2 + ... + bnxn
Weihghted Average: y = b1x1 + b2x2 + ... + bnxn
Usage example
from waveml import WaveRegressor
wr = WaveRegressor()
wr.fit(SX_train, y_train)
wr.predict(SX_test)
Sklearn compatebility
from sklearn.pipeline import Pipeline
pipeline = Pipeline(
steps=[
("Stack_L1", wst),
("Final Estimator", WaveRegressor())
]
)
pipeline.fit(X_train, y_train)
pipeline.predict(X_test)
WaveTransformer
Performs cross validated linear transformations over stacked predictions
Usage example
from waveml import WaveTransformer
wt = WaveTransformer()
wt.fit(X_train, y_train)
wt.transform(X_test)
Sklearn compatebility
pipeline = Pipeline(
steps=[
("Stack_L1", wst),
("LinearTransformations", WaveTransformer()),
("Final Estimator", WaveRegressor())
]
)
WaveEncoder
Performs encoding of categorical features in the initial dataset
from waveml import WaveEncoder
we = WaveEncoder(encodeing_type="label")
X_train = we.fit_transform(X_train)
X_test = we.transform(X_test)
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 waveml-0.2.1.tar.gz
.
File metadata
- Download URL: waveml-0.2.1.tar.gz
- Upload date:
- Size: 9.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.1.post20201107 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 65441ebe8239fcd291b4a142be2ca45378ac3175af065e1ed39680acffabea2e |
|
MD5 | 2824315fcfc3511a7ae5956ee09779ef |
|
BLAKE2b-256 | 40f2c8b0af57d9e04766a1cc01aa101f6edef0c461aa67d6a1c3e014dd10e201 |