PyPI · v1.0.1

Gradient Boosting
for Small Data

XGBoost and LightGBM fail when you have 50–500 samples. SmallGBM is built from the ground up for data-scarce regimes — Bayesian leaf weights, noise stability, and scikit-learn API.

pip install smallgbm Copied!

Why SmallGBM?

Bayesian Leaf Weights

Shrinks leaf predictions toward zero when data is scarce. Prevents overfitting without manual tuning — the prior does the work.

Noise Stability

Degrades gracefully under label noise. At 20% flipped labels, SmallGBM outperforms XGBoost and LightGBM by a wide margin.

scikit-learn Compatible

Drop-in replacement: same fit, predict, predict_proba interface. Works with GridSearchCV, pipelines, everything.

Feature SmallGBM XGBoost LightGBM
Bayesian leaf weights
Adaptive regularization
No bootstrap (uses all data)
Stable under label noise
scikit-learn compatible

Getting Started

Installation

# pip
pip install smallgbm

Classification — 5 lines

from smallgbm import SmallGBMClassifier

model = SmallGBMClassifier()
model.fit(X_train, y_train)
proba = model.predict_proba(X_test)
preds = model.predict(X_test)

Regression — 5 lines

from smallgbm import SmallGBMRegressor

model = SmallGBMRegressor()
model.fit(X_train, y_train)
preds = model.predict(X_test)

API Reference

SmallGBMClassifier

ParameterDefaultDescription
n_estimators50Number of boosting rounds
max_depth3Maximum tree depth
min_samples_leaf3Minimum samples per leaf
learning_rate0.1Shrinkage factor for each tree
sigma_prior0.5Bayesian prior strength
adaptive_priorFalseAuto-set sigma_prior = 1/√n
dynamic_depthFalseDeeper early trees, shallower later
weighted_residualsFalseWeight residuals by confidence
soft_bootstrapFalseSoft bootstrap sampling

SmallGBMRegressor

ParameterDefaultDescription
n_estimators50Number of boosting rounds
max_depth3Maximum tree depth
min_samples_leaf3Minimum samples per leaf
learning_rate0.1Shrinkage factor for each tree
sigma_prior0.5Bayesian prior strength
adaptive_priorFalseAuto-set sigma_prior = 1/√n
dynamic_depthFalseDeeper early trees, shallower later
weighted_residualsFalseWeight residuals by confidence
soft_bootstrapFalseSoft bootstrap sampling

Research

SmallGBM is characterized across 7 experiments in benchmark_final.ipynb. Key findings below.

Noise Stability: SmallGBM vs Baselines

At 20% label noise, SmallGBM is the best performer. Bayesian regularization keeps it stable when XGBoost and LightGBM collapse toward random guessing.

Noise stability comparison

Figure: Test AUC vs label noise. n=60, 10 seeds. Error bars = ±1 std.

Learning Curve

Clear, predictable improvement as data grows. Reliable performance starts at n≈40. No sudden jumps, no catastrophic failures — a safe choice when data is limited.

SmallGBM learning curve

Figure: Test AUC vs training set size. 10 seeds per point. Error bars = ±1 std.

Full characterization notebook with 7 experiments: benchmark_final.ipynb