Skip to main content

BSSCL-GBM

Hybrid Histogram Gradient Boosting Machine

PyPI Version License Python Version Code Audit

BSSCL-GBM is a highly memory-efficient, pure-Python implementation of Gradient Boosting Trees optimized with Numba. It achieves mathematical and statistical parity with C++ giants like XGBoost and LightGBM while maintaining a fundamentally lighter memory footprint.

Developed by Bhaskar, BSSCL-GBM introduces novel algorithmic paradigms including Hybrid uint8 Histogram Binning and mathematically dampened balanced_sqrt Class Weighting (power=0.35) specifically engineered for highly imbalanced datasets (e.g., fraud detection, rare disease prediction).


⚡ Features

  • Hybrid uint8 Binning: Radically reduces Peak RAM (Resident Set Size) consumption by packing numerical feature splits into highly optimized 8-bit integer arrays.
  • Native Missing Value Handling: Automatically routes NaN values during the histogram construction phase without requiring external imputation, successfully stress-tested up to 70% data corruption.
  • Imbalance Eradication: Introduces the balanced_sqrt auto-weighting mechanism (power=0.35) to perfectly dampen severe class imbalances (e.g., 99.9:0.1) without over-penalizing the majority class.
  • Noise Resistance: Proven superior performance on datasets with label noise (5% flip rate), outperforming XGBoost, LightGBM, and CatBoost on all metrics.
  • Numba JIT Compilation: Achieves near C-level looping speeds while remaining a 100% pure Python package.
  • Scikit-Learn API: Fully compatible with standard fit(), predict(), predict_proba() pipelines.
  • Zero Data Leakage: Code audit verified — bin edges, class weights, and categorical encoding are computed strictly from training data.

📦 Installation

Install BSSCL-GBM via pip:

pip install bsscl-gbm

🚀 Quickstart

BSSCL-GBM operates exactly like any standard Scikit-Learn estimator.

from sklearn.datasets import load_breast_cancer
from sklearn.model_selection import train_test_split
from bsscl_gbm import HybridHistGBMNumbaV2

# Load Data
X, y = load_breast_cancer(return_X_y=True)
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)

# Initialize and Train
model = HybridHistGBMNumbaV2(n_estimators=100, max_depth=6)
model.fit(X_train, y_train)

# Predict
preds = model.predict(X_test)
probs = model.predict_proba(X_test)

For highly imbalanced data (e.g., 99:1 split), simply enable the proprietary dampening mechanism:

model = HybridHistGBMNumbaV2(class_weight='balanced_sqrt')

📊 Scientific Benchmarks (v1.0.1)

BSSCL-GBM has been rigorously benchmarked against XGBoost, LightGBM, and CatBoost across 8 diverse datasets using a strict anti-leakage protocol (stratified split, scaler fitted on train only, 3 random seeds averaged). Every competitor was given its best available auto-weighting for maximum fairness.

1. Extreme Imbalance — Credit Card Fraud (284K rows, 99.8% / 0.2%)

Metric BSSCL-GBM XGBoost CatBoost LightGBM
ROC-AUC 0.979 0.971 0.960 0.900
F1 Score 0.835 0.847 0.827 0.077
Brier Score 0.000484 0.000465 0.000500 0.052

2. Noisy Labels — Overlapping Features (50K rows, 98/2, 5% label noise)

Metric BSSCL-GBM XGBoost CatBoost LightGBM
F1 Score 0.505 0.436 0.461 0.355
ROC-AUC 0.713 0.710 0.706 0.706
Brier Score 0.031 0.047 0.038 0.088

BSSCL-GBM wins all 6 metrics on noisy data — the power=0.35 dampening is exceptionally noise-resistant.

3. High-Dimensional Sparse (100K rows, 100 features, 99/1)

Metric BSSCL-GBM XGBoost CatBoost LightGBM
ROC-AUC 0.819 0.805 0.793 0.787
PR-AUC 0.494 0.425 0.363 0.342
Brier Score 0.011 0.013 0.014 0.042

4. Memory Efficiency (Peak RSS)

Framework Peak RAM Usage (1M Rows)
BSSCL-GBM 989.59 MB
XGBoost 1,069.27 MB
LightGBM 1,114.22 MB
CatBoost 1,420.42 MB

🔒 Code Audit (v1.0.1)

A comprehensive line-by-line audit of the full 4,299-line source code confirmed:

Check Status
Data Leakage ✅ None
Gradient/Hessian Math ✅ Correct
Class Weight Logic ✅ Correct
Early Stopping Isolation ✅ Clean
predict_proba Stability ✅ Numerically Safe

📁 Repository Structure

  • /src/bsscl_gbm: The core pure-Python algorithms.
  • /tests: Comprehensive Pytest unit validation suite.
  • /benchmarks/academic: A 20-file scientific proving ground covering Ablation, Imbalance Severity, Learning Curves, and Statistical Significance.
  • /examples: Jupyter notebooks for immediate onboarding.

🤝 Contributing

We welcome contributions! Please check CONTRIBUTING.md and read our CODE_OF_CONDUCT.md.

📝 License & Academic Citation

Released under the Apache 2.0 License.

If you utilize BSSCL-GBM for academic research, please cite it using the provided CITATION.cff file or the following BibTeX:

@software{bsscl_gbm_2026,
  author = {Bhaskar},
  title = {BSSCL-GBM: Hybrid Histogram Gradient Boosting Machine},
  year = {2026},
  url = {https://github.com/Bhaskar19chowdary/bsscl-gbm}
}

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bsscl_gbm-1.0.1.tar.gz (194.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bsscl_gbm-1.0.1-py3-none-any.whl (187.7 kB view details)

Uploaded Python 3

File details

Details for the file bsscl_gbm-1.0.1.tar.gz.

File metadata

  • Download URL: bsscl_gbm-1.0.1.tar.gz
  • Upload date:
  • Size: 194.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for bsscl_gbm-1.0.1.tar.gz
Algorithm Hash digest
SHA256 787e29281edf259524a2d0d647437e64e34c1a29d872cfc79030b16d5ba3e0fd
MD5 0bc78d3fa33790f15ede891066008013
BLAKE2b-256 39cbb6cd1a0fd43f884a237dee8b8d4871c17c9ff7d29e274b6a0a711866cffe

See more details on using hashes here.

Provenance

The following attestation bundles were made for bsscl_gbm-1.0.1.tar.gz:

Publisher: publish.yml on Bhaskar19chowdary/bsscl-gbm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bsscl_gbm-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: bsscl_gbm-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 187.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for bsscl_gbm-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 92bdc3dbf3f05e30c30261a8063d91ba4fa22fa17de4dea1d21338c322da75d4
MD5 77de59f19177420cb6d048a99d39b446
BLAKE2b-256 b37b290b55f7cca452a8972f47d62964ef3d43781ffc5a1c5c1dbf153b50bd50

See more details on using hashes here.

Provenance

The following attestation bundles were made for bsscl_gbm-1.0.1-py3-none-any.whl:

Publisher: publish.yml on Bhaskar19chowdary/bsscl-gbm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 files

1.0.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page