Skip to main content

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

In the browser (Pyodide / JupyterLite)

import micropip
await micropip.install("rfgboost")

Requires Pyodide/JupyterLite ≥ 0.29. rfgboost ships a WASM wheel tagged pyemscripten_2025_0_wasm32 (the only wasm platform tag PyPI accepts); micropip gained support for that tag in Pyodide 0.29, so on older runtimes (0.28.x) micropip.install("rfgboost") fails with "Can't find a pure Python 3 wheel." The categorical/WOE path (WoeEncoder) is unavailable in-browser — fastwoe-rs has no WASM wheel — but the numeric RFGBoost* estimators work.

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

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.2.2.tar.gz (847.4 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.2.2-cp39-abi3-win_amd64.whl (456.2 kB view details)

Uploaded CPython 3.9+Windows x86-64

rfgboost-0.2.2-cp39-abi3-pyemscripten_2025_0_wasm32.whl (215.0 kB view details)

Uploaded CPython 3.9+PyEmscripten 2025.0 wasm32

rfgboost-0.2.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (634.2 kB view details)

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

rfgboost-0.2.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (620.4 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

rfgboost-0.2.2-cp39-abi3-macosx_11_0_arm64.whl (553.9 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

rfgboost-0.2.2-cp39-abi3-macosx_10_12_x86_64.whl (564.6 kB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

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

File metadata

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

File hashes

Hashes for rfgboost-0.2.2.tar.gz
Algorithm Hash digest
SHA256 c0ebefe490db2d9437d59934876f97977536d1df31097f2c50cccb35d6bb3ffc
MD5 9bf1c99734d5c3d1deeb2a8011cacfb4
BLAKE2b-256 0d2d637a912d3ec2bbc256ec73f707e6a752776be8dc7ab18297eccd59551ed3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: rfgboost-0.2.2-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 456.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.2.2-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 a181d7a8e6b98ccec3469e6f292a1168a281978893527d6314afba90d192de4e
MD5 253cd1b1db06cf10afa1fdaa2a251f7b
BLAKE2b-256 a69cde0c2a105dd83fc68be0018a905cb1a5d41f969518239719a05568ea33ca

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rfgboost-0.2.2-cp39-abi3-pyemscripten_2025_0_wasm32.whl
Algorithm Hash digest
SHA256 09261ac3f982036a335d3ed4af97288be27b86c6c499bb8bbada384d94b4bb69
MD5 5469839a5815b2f35774a90245cdce9f
BLAKE2b-256 76de847e7ff803a9c2a8c266cdf299a5709a660ae323a56289ae3343f24d3618

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rfgboost-0.2.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8d4b33fc98e58486d06479aacf79dc221ddf1a6773b4d71afcb1e4c9b27be668
MD5 5a76e18fce7e6766c8ab631536c1c05c
BLAKE2b-256 e471c83e12756182543cfccb764d045d30a901e4aa19da2295720c906ebc2a07

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rfgboost-0.2.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 e1c625ac858cac885557b1c5addec82b336b8d8113bf9a508473f060d3cc195d
MD5 9d9e6ddd465f0ac4f2197748c7cfeedb
BLAKE2b-256 3db8d573b3955b833c8a6198ca990f2fd96a71485710ed15c87ad62ab7c41eed

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rfgboost-0.2.2-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 aeb89bdece1b978280d774c778acce30fbefee5029ea580ac14b2da56f1f12d6
MD5 81011928921fec34b503ce309d45e950
BLAKE2b-256 6563344a3cdcfb3b7d17b3f7e37d51f682f748b3d969ba06d7559387fb090f6f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rfgboost-0.2.2-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 839dc91a2f636be440ae8ed515be16061ccc7e84f01c825806688c8edee4607f
MD5 9b4061cdce5f492ca8421af3e8c01af1
BLAKE2b-256 75fa089cde899f1ad185544261a9d7122445b8d5c42aad6a061ea569f6467e32

See more details on using hashes here.

Release history Release notifications | RSS feed

0.2.3

7 files

This release

0.2.2 This release

7 files

0.2.0

7 files

0.1.2

7 files

0.1.1

7 files

0.1.0

30 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