https://github.com/krzjoa/scikit-gbm
scikit-learn compatible tools to work with GBM models
https://github.com/krzjoa/scikit-gbm
data-science feature-engineering gbm gradient-boosting machine-learning scikit-learn
Last synced: 11 months ago
JSON representation
scikit-learn compatible tools to work with GBM models
- Host: GitHub
- URL: https://github.com/krzjoa/scikit-gbm
- Owner: krzjoa
- License: mit
- Created: 2023-04-14T22:43:53.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-08-12T21:37:08.000Z (almost 3 years ago)
- Last Synced: 2025-06-19T21:05:09.483Z (12 months ago)
- Topics: data-science, feature-engineering, gbm, gradient-boosting, machine-learning, scikit-learn
- Language: Python
- Homepage: https://scikit-gbm.readthedocs.io
- Size: 3.28 MB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# scikit-gbm
[](https://scikit-gbm.readthedocs.io/en/latest/?badge=latest)
[](https://badge.fury.io/py/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`
* `AXIL`
Take a look at the [documentation](https://scikit-gbm.readthedocs.io/en/latest/?badge=latest) to learn more.
A simple example, how to use `GBMFeaturizer` in a classification task.
```python
# 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)
```