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:
GBMFeaturizerGBMDiscretizertrees_to_dataframeAXIL
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 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.2.1.tar.gz
(17.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file scikit-gbm-0.2.1.tar.gz.
File metadata
- Download URL: scikit-gbm-0.2.1.tar.gz
- Upload date:
- Size: 17.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c404bd890b1fc014f5d7f12e771a473dba2499e8ce578091fd98031813e79cd8
|
|
| MD5 |
104f7165158ac12688652af17bec062c
|
|
| BLAKE2b-256 |
1644d9dec201b093bee9f76c1296e374f690c047fc064374870c77dc9aae42cf
|
File details
Details for the file scikit_gbm-0.2.1-py3-none-any.whl.
File metadata
- Download URL: scikit_gbm-0.2.1-py3-none-any.whl
- Upload date:
- Size: 22.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ab96f12859280d7080c38b1a84dd392a7f088269f35aae6e6184ab6be568f5fe
|
|
| MD5 |
23bf73f7a1648365076d6f3aa26e8eff
|
|
| BLAKE2b-256 |
7ec1a876f1f200747a7df29b6483d4bc3f48d7d124ba6c1101559230ab5d5343
|