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

# Regression
reg = TriBoostRegressor(n_trees=500, learning_rate=0.1).fit(X_train, y_train)
pred = reg.predict(X_test)

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

# Multiclass (native softmax) — same API, K>=3 classes
mclf = TriBoostClassifier(n_trees=1000, validation_fraction=0.1).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.0.tar.gz (281.6 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.0-cp310-abi3-win_amd64.whl (1.0 MB view details)

Uploaded CPython 3.10+Windows x86-64

tri_boost-0.2.0-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.0-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.0-cp310-abi3-macosx_11_0_arm64.whl (1.1 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

tri_boost-0.2.0-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.0.tar.gz.

File metadata

  • Download URL: tri_boost-0.2.0.tar.gz
  • Upload date:
  • Size: 281.6 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.0.tar.gz
Algorithm Hash digest
SHA256 3738b88a82ea15e22b2d625e7f17d94b0b61a61194fa6df2ff1234e38ed41347
MD5 a2e0973821c363190e678866bf0299a0
BLAKE2b-256 2a3829c2f464b499f9126e67f44b41b5fb8cdd5f8fc6574700590f9ade7059a7

See more details on using hashes here.

Provenance

The following attestation bundles were made for tri_boost-0.2.0.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.0-cp310-abi3-win_amd64.whl.

File metadata

  • Download URL: tri_boost-0.2.0-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.0-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 1fc1a3b667dca9f7ebea8d710fa505e3fdc9b02153b6014cfda31ce183ea4eaf
MD5 77a1784ad1ada4a730f5edc941905e9d
BLAKE2b-256 281c6c31b0079af5fd81f667ae5145d7b002718b132dfc293888be080d263f67

See more details on using hashes here.

Provenance

The following attestation bundles were made for tri_boost-0.2.0-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.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for tri_boost-0.2.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d5f75eb00e120a18731a279fd0a1b5b38da9178edfe2efe4b46c3ce7c15c1e6b
MD5 6eff8658a5b34dfc90b97966f9467076
BLAKE2b-256 a33d1dbf34fe3a49354a4a90b603a813ba79774b670b88092d7b6c32642f7086

See more details on using hashes here.

Provenance

The following attestation bundles were made for tri_boost-0.2.0-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.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for tri_boost-0.2.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 d2bcbc7a170c52e3caf70515a37a13c3d5d910844b2612d980dfc0cb69abcb72
MD5 a2921af28686324a2fb6caa7dc324b0e
BLAKE2b-256 20e6830f27e9bfa0e2c82e61d30f6e7155e9b399ef94f8b28b8fb77cffa9233a

See more details on using hashes here.

Provenance

The following attestation bundles were made for tri_boost-0.2.0-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.0-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for tri_boost-0.2.0-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1a18d019bc50b7e8111e106b2889a3e5510b99bbacb1c227ac7a21ce54975b2f
MD5 bcfcad85ec2510081b4adf9f7c156166
BLAKE2b-256 365b01a3d3b36b64d9cad830d94737914d7525a17c7b732a4e5702837b72e6e8

See more details on using hashes here.

Provenance

The following attestation bundles were made for tri_boost-0.2.0-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.0-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for tri_boost-0.2.0-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 653775815408923f0a609e9de2b913b282b7d5e6625cee49483e244e7e004f5d
MD5 db601e1b809d07ee990954ccd2c85c97
BLAKE2b-256 e63e40d48758cee95bb92107b8b9140704df018a9ab727b851faa9dbd5f50956

See more details on using hashes here.

Provenance

The following attestation bundles were made for tri_boost-0.2.0-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