scikit-learn compatible tools to work with GBM models
Project description
scikit-gbm
scikit-learn compatible tools to work with GBM models
Installation
pip install scikit-gbm
# or
pip install git+https://github.com/krzjoa/scikit-gbm.git
Usage
Fo the moment, you can find the following tools in the library:
GBMFeaturizer
GBMDiscretizer
trees_to_dataframe
Take a look at the documentation to learn more.
A simple example, how to use GBMFeaturizer
in a classification task.
# Classification
from sklearn.datasets import make_classification
from sklearn.model_selection import train_test_split
from sklearn.pipeline import Pipeline
from sklearn.linear_model import LogisticRegression
from skgbm.preprocessing import GBMFeaturizer
from lightgbm import LGBMRegressor
from xgboost import XGBClassifier
X, y = make_classification()
X_train, X_test, y_train, y_test = train_test_split(X, y)
pipeline = \
Pipeline([
('gbm_featurizer', GBMFeaturizer(XGBClassifier())),
('logistic_regression', LogisticRegression())
])
# Try also:
# ('gbm_featurizer', GBMFeaturizer(GradientBoostingClassifier())),
# ('gbm_featurizer', GBMFeaturizer(LGBMClassifier())),
# ('gbm_featurizer', GBMFeaturizer(CatBoostClassifier())),
# Predictions for the test set
pipeline_pred = pipeline.predict(X_test)
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
scikit-gbm-0.1.1.tar.gz
(11.3 kB
view hashes)
Built Distribution
scikit_gbm-0.1.1-py3-none-any.whl
(14.2 kB
view hashes)
Close
Hashes for scikit_gbm-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c343914309ae184fb5b80ef20a49a09ccb6877fe52cc41e46d8d40b9e78aacd |
|
MD5 | 20ca1dd0e599156cd1a66143a9cd1c1a |
|
BLAKE2b-256 | 7b6f8ac962ea93dadbac68d70c0fb387f6f83187f56154d42ed3439100b19eb4 |