Support Tools for Machine Learning VIVIDLY
Project description
Vivid
Support Tools for Machine Learning Vividly 🚀
Usage
from sklearn.datasets import load_boston
import pandas as pd
from vivid.out_of_fold.boosting import LGBMRegressorOutOfFold
X, y = load_boston(return_X_y=True)
df = pd.DataFrame(X)
model = LGBMRegressorOutOfFold(name='lgbm', cv=6, root_dir='./')
easy to make more and more complex stacking model
copy_feat = CopyFeature(name='copy', root_dir='./boston_stacking')
process_feat = BostonProcessFeature(name='boston_base', root_dir='./boston_stacking')
concat_faet = [copy_feat, process_feat]
singles = [
XGBoostRegressorOutOfFold(name='xgb_simple', parent=concat_faet),
RFRegressorFeatureOutOfFold(name='rf', parent=concat_faet),
KNeighborRegressorOutOfFold(name='kneighbor', parent=concat_faet),
OptunaXGBRegressionOutOfFold(name='xgb_optuna', n_trials=20, parent=concat_faet),
# seed averaging block
create_boosting_seed_blocks(feature_class=XGBoostRegressorOutOfFold, prefix='xgb_', parent=concat_faet),
create_boosting_seed_blocks(feature_class=LGBMRegressorOutOfFold, prefix='lgbm_', parent=concat_faet),
# only processed feature
create_boosting_seed_blocks(feature_class=LGBMRegressorOutOfFold, prefix='only_process_lgbm_',
parent=process_feat)
]
ens = EnsembleFeature(name='ensumble', parent=singles) # ensemble of stackings
# create stacking models
stackings = [
# ridge model has single models as input
RidgeOutOfFold(name='stacking_ridge', parent=singles, n_trials=10),
# xgboost parameter tuned by optuna
OptunaXGBRegressionOutOfFold(name='stacking_xgb', parent=singles, n_trials=100),
]
stacking_stacking_knn \
= KNeighborRegressorOutOfFold(name='stacking_stacking_knn', parent=stackings)
naive_xgb = XGBoostRegressorOutOfFold(name='naive_xgb', parent=copy_feat)
ens_all = RidgeOutOfFold(name='all_ridge', parent=[*singles, *stackings, ens, stacking_stacking_knn, naive_xgb])
ens_all.fit(train_df, y)
Install
pip install git+https://gitlab.com/nyker510/vivid
Sample Code
In /vivid/smaples
, Some sample script codes exist.
Developer
Requirements
- docker
- docker-compose
create docker-image from docker-compose file
docker-compose build
docker-compose up -d
docker exec -it vivid-test bash
Test
use pytest
for test tool (see gitlab-ci.yml).
pytest tests
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
python-vivid-0.3.1.1.tar.gz
(129.7 kB
view hashes)
Built Distribution
Close
Hashes for python_vivid-0.3.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1599179c186e3a4ca59914262c994448b84e4570fd91bc15f4a5c934fd4a1848 |
|
MD5 | 486e555d197404c0cf18fdb9d3ed9a07 |
|
BLAKE2b-256 | 99d3b5018419ad1a5b9efcacde13e7a1605b9b5fd7e9dd072e1d26ea0f9d82ac |