Skip to main content

RFGBoost: async Random Forest + gradient boosting engine in Rust with CI-based convergence

Project description

rfgboost

Gradient boosting with asynchronous random forests, implemented in Rust with Python bindings.

Installation

pip install rfgboost

From source (requires Rust toolchain):

pip install maturin
maturin develop --release

Quick Start

from rfgboost import RFGBoostClassifier, RFGBoostRegressor

# Classification
clf = RFGBoostClassifier(n_estimators=20, rf_n_estimators=50, rf_max_depth=6)
clf.fit(X_train, y_train)
proba = clf.predict_proba(X_test)
ci = clf.predict_ci(X_test)  # Wilson score intervals

# Regression
reg = RFGBoostRegressor(n_estimators=20, rf_n_estimators=50, rf_max_depth=6)
reg.fit(X_train, y_train)
pred = reg.predict(X_test)
ci = reg.predict_ci(X_test)  # Split conformal prediction intervals

# Async mode (adaptive early stopping via CI convergence)
clf = RFGBoostClassifier(async_mode=True, tol=0.0)

# Categorical features (WOE encoding via fastwoe-rs)
clf = RFGBoostClassifier(cat_features=[0, 1, 2])

Components

Class Description
RFGBoostClassifier Gradient boosting with RF base learners (binary + multiclass)
RFGBoostRegressor Gradient boosting with RF base learners (regression)
RandomForestClassifier Standalone random forest classifier
RandomForestRegressor Standalone random forest regressor
RandomForestUnsupervised Breiman's unsupervised RF (proximity, outliers, MDS)
DecisionTree Single decision tree (exact sklearn match)
TreeSHAP Exact tree-path-dependent SHAP values

Key Features

  • Async tree building: Rayon work-stealing with AtomicBool convergence flag. Unstarted trees skip once the ensemble converges.
  • CI-based stopping: Wilson intervals (classification) and normal CI (regression) determine convergence automatically with tol=0.
  • Histogram splitting: 256-bin quantile histograms for O(n + bins) split search.
  • Conformal prediction: Split conformal CIs for regression with coverage guarantees.
  • Unsupervised RF: Proximity matrix, outlier detection, MDS embedding, feature importance from Breiman's original method.
  • Exact TreeSHAP: Matches the official SHAP package to machine precision.

License

MIT

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

rfgboost-0.1.1.tar.gz (443.0 kB view details)

Uploaded Source

Built Distributions

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

rfgboost-0.1.1-cp39-abi3-win_amd64.whl (438.2 kB view details)

Uploaded CPython 3.9+Windows x86-64

rfgboost-0.1.1-cp39-abi3-pyemscripten_2025_0_wasm32.whl (204.7 kB view details)

Uploaded CPython 3.9+PyEmscripten 2025.0 wasm32

rfgboost-0.1.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (621.6 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ x86-64

rfgboost-0.1.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (601.4 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

rfgboost-0.1.1-cp39-abi3-macosx_11_0_arm64.whl (542.0 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

rfgboost-0.1.1-cp39-abi3-macosx_10_12_x86_64.whl (553.1 kB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

Details for the file rfgboost-0.1.1.tar.gz.

File metadata

  • Download URL: rfgboost-0.1.1.tar.gz
  • Upload date:
  • Size: 443.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for rfgboost-0.1.1.tar.gz
Algorithm Hash digest
SHA256 324ab25c489492d4b510a374c18f32f41d0e79d490cdebe245973b4587adb2f1
MD5 fa2afcbdab42cbb732e1e915adb4e355
BLAKE2b-256 cd880da0c0142465842d9da0b36d923590f242ca4d6f9eb7c2b8c4400ef50dfd

See more details on using hashes here.

File details

Details for the file rfgboost-0.1.1-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: rfgboost-0.1.1-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 438.2 kB
  • Tags: CPython 3.9+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for rfgboost-0.1.1-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 13e3cc7b2af0e2aff2b445d61f5ee64607ecaba678cb55d139d157b0046bdcc8
MD5 24ee416b7aad6b965df99daef1efc477
BLAKE2b-256 b67109ea91c50f2694401a556945776102b44c679d577763f02de2b1e3a297ef

See more details on using hashes here.

File details

Details for the file rfgboost-0.1.1-cp39-abi3-pyemscripten_2025_0_wasm32.whl.

File metadata

File hashes

Hashes for rfgboost-0.1.1-cp39-abi3-pyemscripten_2025_0_wasm32.whl
Algorithm Hash digest
SHA256 833656d042263ef89b7956e0da00d2c4f4d244d27fcae3b55893985d83bad6b6
MD5 20090a6e3f45dec8f35e8c454e87e308
BLAKE2b-256 b93ef1f06e7182ef4110b6cc361541f810bfc2f5a7c881433f20824be9d7b8ce

See more details on using hashes here.

File details

Details for the file rfgboost-0.1.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rfgboost-0.1.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3201ffb27e39874e4553b7a9cb7921e7041f5ac30740e816937aa1ae30ef3cb5
MD5 e046f8fb8a8e1746752e65ce0f6d6829
BLAKE2b-256 d00af612b9bab7d33f4c6cb8d852c3d45250fd97f328dde72d19352b13c54f75

See more details on using hashes here.

File details

Details for the file rfgboost-0.1.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for rfgboost-0.1.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 f8d4582189256d69db184308107705bb841348ca43ef71c0e9894c87260f800b
MD5 e865963f30b25a2efcc3f96303098e9c
BLAKE2b-256 d2710f5b1c1798dca67b6d30f4d599aac91eae70db18177ea09893d8231e7c59

See more details on using hashes here.

File details

Details for the file rfgboost-0.1.1-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rfgboost-0.1.1-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1a54b8e1b01a09db3108cf53640a219afa4bc46ba1b733b021a5f9e3c22ffa21
MD5 ca105cef9671e34fdb742296e49ada05
BLAKE2b-256 a194d1d7e2b2543bd185574ded1040446b010962be6e097c8b89a6cfb027f421

See more details on using hashes here.

File details

Details for the file rfgboost-0.1.1-cp39-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for rfgboost-0.1.1-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 ddadb10a0a3eae1ccff885a70cb65f6e3c1e54c08ea121f5c186deb306a2be3d
MD5 e827f9434717098705c591736944f235
BLAKE2b-256 1068d1b573fd0b15ebc6c6ef978fa8749afe917ae237e552a78459bb888d8ed6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page