Skip to main content

A depth-3 oblivious GBM that is exactly decomposable into ≤3rd-order fANOVA tables.

Project description

tri-boost

A depth-3 oblivious gradient-boosting machine that is exactly decomposable into ≤3rd-order functional-ANOVA (fANOVA) "rating tables" — without giving up accuracy or speed.

Every tree is a depth-1..=3 symmetric (oblivious) tree with one shared (feature, threshold) test per level and at most three distinct raw features, so the trained ensemble truncates exactly at the 3rd interaction order. That structure lets the fitted model be rewritten, losslessly, as a small set of main-effect and interaction tables that reproduce the model's predictions bit-for-bit — a glass-box GBM you can read, ship as lookup tables, or audit.

  • Rust core (tri-boost-core), thin PyO3 bindings, and scikit-learn estimators. The core is #![forbid(unsafe_code)], no-panic-gated, and deterministic (bit-identical across thread counts).
  • scikit-learn compatible: TriBoostRegressor / TriBoostClassifier drop into Pipeline, GridSearchCV, cross_val_score.
  • Objectives: squared_error, logistic (binary), native-softmax multiclass, and the log-link poisson / gamma / tweedie families for insurance frequency & severity.
  • Exact decomposition: model.tables(X) emits the ≤3rd-order fANOVA tables; the reconstruction is verified against the ensemble by five lossless invariant checks.

Install

pip install tri-boost            # numpy-only core (raw booster API)
pip install "tri-boost[sklearn]" # + the scikit-learn estimators

Wheels are built for Linux / macOS / Windows as a single abi3 wheel per platform (CPython 3.10–3.13).

From source

Building from source needs a Rust toolchain (rustup) and maturin:

pip install maturin
maturin develop --release        # builds the Rust extension into the active venv

Quickstart

import numpy as np
from tri_boost import TriBoostRegressor, TriBoostClassifier

# Constructor defaults embed the recommended recipe (early stopping against a large n_trees cap,
# leaf refinement, outer bagging), so a bare estimator performs well without tuning.

# Regression
reg = TriBoostRegressor().fit(X_train, y_train)
pred = reg.predict(X_test)

# Binary classification
clf = TriBoostClassifier().fit(X_train, y_binary)
proba = clf.predict_proba(X_test)        # (n, 2)

# Multiclass (native softmax) — same API, K>=3 classes
mclf = TriBoostClassifier().fit(X_train, y_multiclass)
proba = mclf.predict_proba(X_test)       # (n, K), rows sum to 1

The exact decomposition

import json
tables = json.loads(clf.tables(X_sample))   # ≤3rd-order fANOVA rating tables (JSON)

Each fitted model decomposes into main effects and ≤3-way interactions that reproduce the raw score exactly (for a multiclass model, one table bank per class logit).

Objectives

Objective Task Link
squared_error regression identity
logistic binary classification logit
softmax (automatic for TriBoostClassifier with ≥3 classes) multiclass softmax
poisson counts / frequency log
gamma positive severities log
tweedie compound Poisson-gamma log

Status & license

Pre-1.0; the wire schema_version is versioned independently of the package version. Licensed under Apache-2.0.

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

tri_boost-0.2.1.tar.gz (282.2 kB view details)

Uploaded Source

Built Distributions

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

tri_boost-0.2.1-cp310-abi3-win_amd64.whl (1.0 MB view details)

Uploaded CPython 3.10+Windows x86-64

tri_boost-0.2.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view details)

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

tri_boost-0.2.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.2 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64

tri_boost-0.2.1-cp310-abi3-macosx_11_0_arm64.whl (1.1 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

tri_boost-0.2.1-cp310-abi3-macosx_10_12_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.10+macOS 10.12+ x86-64

File details

Details for the file tri_boost-0.2.1.tar.gz.

File metadata

  • Download URL: tri_boost-0.2.1.tar.gz
  • Upload date:
  • Size: 282.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for tri_boost-0.2.1.tar.gz
Algorithm Hash digest
SHA256 e4b3722c4392be6153d1f41816ca345cd86fa50856b87630d02a4677dc6ac4e8
MD5 36560c395954051f6bc9c1f86aafd878
BLAKE2b-256 91ab09256e9ed16b8231de912990cea8ce8163e194208e6d693521ade4dacc3c

See more details on using hashes here.

Provenance

The following attestation bundles were made for tri_boost-0.2.1.tar.gz:

Publisher: release.yml on PricingFrontier/tri-boost

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

File details

Details for the file tri_boost-0.2.1-cp310-abi3-win_amd64.whl.

File metadata

  • Download URL: tri_boost-0.2.1-cp310-abi3-win_amd64.whl
  • Upload date:
  • Size: 1.0 MB
  • Tags: CPython 3.10+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for tri_boost-0.2.1-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 ef288208795d6cc3d4d896ae6728ee83422577e574531a8e6548803de587edd9
MD5 414717d21ad382b1af3cc1ad9e428b45
BLAKE2b-256 036713859d7a8bd358234aa06ec6c86b77e548b397e2d905fa4c5f8a444a5a41

See more details on using hashes here.

Provenance

The following attestation bundles were made for tri_boost-0.2.1-cp310-abi3-win_amd64.whl:

Publisher: release.yml on PricingFrontier/tri-boost

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

File details

Details for the file tri_boost-0.2.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for tri_boost-0.2.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8209d6cf94e576b07754d9379ffcf7649025e94f92bdec29a672f9086c152849
MD5 df62bdc3ecbfc347779270db87e9c289
BLAKE2b-256 a407cd21b9ab0bfd23ee9b41ecae540a4ef3e70284fb040ebf4239e664cff411

See more details on using hashes here.

Provenance

The following attestation bundles were made for tri_boost-0.2.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on PricingFrontier/tri-boost

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

File details

Details for the file tri_boost-0.2.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for tri_boost-0.2.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 3ecd49a993c648590d3bcbacce4a8401c747709ad594f92ae72f083d9081c765
MD5 4865aacc0aa87355667681c2129e699e
BLAKE2b-256 62db118f8c9dfb6055bdbc3b9e101820775b3fe27dd081d0078a007b5faa95e7

See more details on using hashes here.

Provenance

The following attestation bundles were made for tri_boost-0.2.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release.yml on PricingFrontier/tri-boost

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

File details

Details for the file tri_boost-0.2.1-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for tri_boost-0.2.1-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c51cae6a72ca314717092caa46da9743f5bbd334f48bf4b889ca8353c2ec54fa
MD5 04f9558e62c99337c3bd1b4659d23ae9
BLAKE2b-256 c454cfb90c85569f39dd233cc73aea45b9648a30eb9632c27b35d41b2c319e11

See more details on using hashes here.

Provenance

The following attestation bundles were made for tri_boost-0.2.1-cp310-abi3-macosx_11_0_arm64.whl:

Publisher: release.yml on PricingFrontier/tri-boost

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

File details

Details for the file tri_boost-0.2.1-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for tri_boost-0.2.1-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 356e8c840acd8cb950486e6b1793eeaea2f857d289ab9903d58c90fb2e5d45e5
MD5 bf07b811c547d0a22baaed34d4d4e670
BLAKE2b-256 318c92a1ca7779bc3176125cbabc83f1128e0902242ab25e47be35e8e9bb84c4

See more details on using hashes here.

Provenance

The following attestation bundles were made for tri_boost-0.2.1-cp310-abi3-macosx_10_12_x86_64.whl:

Publisher: release.yml on PricingFrontier/tri-boost

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

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