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.2.tar.gz (820.6 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.2-cp39-abi3-win_amd64.whl (438.5 kB view details)

Uploaded CPython 3.9+Windows x86-64

rfgboost-0.1.2-cp39-abi3-pyemscripten_2025_0_wasm32.whl (207.9 kB view details)

Uploaded CPython 3.9+PyEmscripten 2025.0 wasm32

rfgboost-0.1.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (622.0 kB view details)

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

rfgboost-0.1.2-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.2-cp39-abi3-macosx_11_0_arm64.whl (542.0 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

rfgboost-0.1.2-cp39-abi3-macosx_10_12_x86_64.whl (553.3 kB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: rfgboost-0.1.2.tar.gz
  • Upload date:
  • Size: 820.6 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.2.tar.gz
Algorithm Hash digest
SHA256 e56efcf5eafb4c0ee0e35530926ece4d40b0a3c771cd48230e45edffaa037a4b
MD5 ed6b41fd2da4e1699ae6ddaef722ac7e
BLAKE2b-256 4c2dd93d376d0e321dd4d0cb11c9068c9aeb993e2ebbbc441e6d1dfb243c89a9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: rfgboost-0.1.2-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 438.5 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.2-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 1729afb10d409b5162efdfac834126c6bd4cc9a6bdaaf1c98da6d3d3742ad4b1
MD5 90516ceb9d12b057a79764f3b330d939
BLAKE2b-256 9590471ab9425a3e192388aa79a65e2085e43b7f0e33addf83e4349c526c0467

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rfgboost-0.1.2-cp39-abi3-pyemscripten_2025_0_wasm32.whl
Algorithm Hash digest
SHA256 7605666b1fa5c48959e4a8c5992ecaf4313c526999965532ce448de87cb48e96
MD5 64f0ecd7a822436cd4164638d5f19a08
BLAKE2b-256 eab3ad4a412a5db68e304c0f3faea736e997e359cf2c28bc7afd38cb5ce97154

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rfgboost-0.1.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0f5666f7aa17a11538f664a1e8adcd52521ba41f3b8d1d3e223ce3f5e694581b
MD5 c08e893eda5d0375eccdafd8e99e3e38
BLAKE2b-256 fc35491185729d70b59490b5f78c8a268c9e3b4f2cedef61879e419c6243a8cc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rfgboost-0.1.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 a5cc7e8f10a969092c11098c42bce31d4c869bf4ec34777b87e6581901fd3ffa
MD5 cc21b0457b2e482c3f01ecee8998ac73
BLAKE2b-256 c6102d6dfa0b98aa5156c2df52d0032a4529b24e5501ae9d77e0e7632171c67d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rfgboost-0.1.2-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1f13f95e0677e61e963b061b70f902ac64887761b89076c0576c1b3f0c17b255
MD5 6ec82cf130b2afe73e64eb512e46a68e
BLAKE2b-256 7bbeb2e29ba0d3ccdb2ab54af244d5650d03a4352defa89df4dfc1752130f9d2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rfgboost-0.1.2-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 80bdc667d8b582e787b8981db62867f9ab4d90adfb7ba4d91c679c2722837fea
MD5 80410b4f24eed65b52fa70242b4951e1
BLAKE2b-256 723106415d837cde30754c887304fd1791f599951cc797691c47bc8a3b4793eb

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