Boosters Python
Fast gradient boosting library with native Rust core. Provides both a core API and sklearn-compatible estimators.
📚 Full Documentation — See the main documentation for tutorials, API reference, and guides.
Features
- High Performance: Native Rust core with Python bindings via PyO3
- sklearn Compatible: Works with
Pipeline,cross_val_score,GridSearchCV - Multiple Objectives: Regression, classification, ranking, quantile regression
- GBDT & Linear: Both tree-based and linear boosting models
Installation
# Development install from workspace root
cd /path/to/booste-rs
uv run maturin develop -m packages/boosters-python/Cargo.toml
Quick Start
sklearn API (Recommended)
The sklearn-compatible estimators provide familiar flat kwargs:
from boosters.sklearn import GBDTRegressor, GBDTClassifier
import numpy as np
# Regression
X = np.random.randn(100, 5).astype(np.float32)
y = X[:, 0] + np.random.randn(100).astype(np.float32) * 0.1
reg = GBDTRegressor(max_depth=5, n_estimators=100)
reg.fit(X, y)
predictions = reg.predict(X)
# Binary classification
y_cls = (X[:, 0] > 0).astype(int)
clf = GBDTClassifier(n_estimators=50)
clf.fit(X, y_cls)
proba = clf.predict_proba(X)
# Multiclass classification (explicit objective required)
from boosters import Objective
y_multi = np.random.randint(0, 3, size=100)
clf_multi = GBDTClassifier(
n_estimators=50,
objective=Objective.softmax(n_classes=3)
)
clf_multi.fit(X, y_multi)
Core API
The core API provides full control with flat config parameters:
import boosters as bst
import numpy as np
# Create config
config = bst.GBDTConfig(
n_estimators=100,
learning_rate=0.1,
objective=bst.Objective.squared(),
metric=bst.Metric.rmse(),
max_depth=5,
l2=1.0,
)
# Create model and train
X = np.random.randn(100, 10).astype(np.float32)
y = np.random.randn(100).astype(np.float32)
model = bst.GBDTModel(config=config)
train_data = bst.Dataset(X, y)
model.fit(train_data)
# Predict
predictions = model.predict(bst.Dataset(X))
sklearn Integration
Works seamlessly with sklearn tools:
from sklearn.model_selection import cross_val_score, GridSearchCV
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import StandardScaler
from boosters.sklearn import GBDTRegressor
# Cross-validation
scores = cross_val_score(GBDTRegressor(), X, y, cv=5)
# Pipeline
pipe = Pipeline([
('scaler', StandardScaler()),
('model', GBDTRegressor(n_estimators=50)),
])
pipe.fit(X, y)
# Grid search
param_grid = {'n_estimators': [50, 100], 'max_depth': [3, 5]}
grid = GridSearchCV(GBDTRegressor(), param_grid, cv=3)
grid.fit(X, y)
API Reference
sklearn Estimators
| Class | Description |
|---|---|
GBDTRegressor |
Gradient boosted trees for regression |
GBDTClassifier |
Gradient boosted trees for classification |
GBLinearRegressor |
Gradient boosted linear model for regression |
GBLinearClassifier |
Gradient boosted linear model for classification |
Core Types
| Class | Description |
|---|---|
GBDTModel |
Tree-based gradient boosting model |
GBLinearModel |
Linear gradient boosting model |
GBDTConfig |
Configuration for GBDT models |
GBLinearConfig |
Configuration for linear models |
Dataset |
Data wrapper for features and labels |
Objectives
| Method | Description |
|---|---|
Objective.squared() |
L2 regression |
Objective.absolute() |
L1 regression |
Objective.huber(delta) |
Huber loss |
Objective.logistic() |
Binary classification |
Objective.softmax(n_classes) |
Multiclass classification |
Objective.poisson() |
Poisson regression |
Objective.pinball(alpha) |
Quantile regression |
Objective.lambdarank(ndcg_at) |
Learning to rank |
Metrics
| Method | Description |
|---|---|
Metric.rmse() |
Root mean squared error |
Metric.mae() |
Mean absolute error |
Metric.logloss() |
Log loss / cross-entropy |
Metric.auc() |
Area under ROC curve |
Metric.Accuracy() |
Classification accuracy |
Metric.ndcg(at) |
Normalized discounted cumulative gain |
Examples
See the examples/ directory:
- 01_sklearn_quickstart.py - Basic sklearn API usage
- 02_core_api.py - Core API with full control
- 03_sklearn_integration.py - Pipeline, cross-validation, grid search
- 04_linear_models.py - GBLinear models
License
MIT
Metadata
Release files for boosters 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| boosters-0.1.0.tar.gz | 388.3 kB | With provenance | Details |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| boosters-0.1.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.12 | abi3 | Linux glibc 2.17+ x86-64 | Details |
| boosters-0.1.0-cp312-abi3-macosx_11_0_arm64.whl | CPython 3.12 | abi3 | macOS 11.0+ ARM64 | Details |
Total release size: 3.0 MB
Release files / boosters-0.1.0.tar.gz
| Download URL | boosters-0.1.0.tar.gz |
|---|---|
| Size | 388.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bee21b178b46566478dc4ab8d0cabe1d74204f7227d0d771500ae264f7820d74
|
|
BLAKE2b-256 checksum How to use checksums |
8042915bcc993f87454b490cec5476a583388d1fb01ed1b8b23e415e2e05c7dd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 14, 2026.
Transparency logRelease files / boosters-0.1.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | boosters-0.1.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 1.4 MB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
c415f36c3b6588ab17a2007231c48f99a10fa62edf9de67340cccfb23e723b35
|
|
BLAKE2b-256 checksum How to use checksums |
c705f63ab47a35f087d2800da9183a87f18693d75db952f3837c51a522854786
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 14, 2026.
Transparency logRelease files / boosters-0.1.0-cp312-abi3-macosx_11_0_arm64.whl
| Download URL | boosters-0.1.0-cp312-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 1.2 MB |
| Tags | CPython 3.12 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
9bd5ba708874182741feb1b11ebc3e35780301867482fb62f071442de6e1ef98
|
|
BLAKE2b-256 checksum How to use checksums |
2a5346c094109782db2485c3b5ea89611574ad8966266470b6296485d8688317
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 15, 2026.
Transparency logSecurity for boosters 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 3 files in this release have been uploaded with provenance metadata.
Attestation for boosters-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 14, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.