Skip to main content

t-boost

A Tabulating Boosting Machine (TBM): gradient boosting whose fitted model is exactly a set of rating tables.

Why

Gradient-boosted trees are usually more accurate than a GLM, but they are hard to read, review or deploy in systems built around rating tables. t-boost aims to get boosting-level accuracy in a model that is a set of main-effect and interaction tables, with no approximation and no surrogate model.

How it works

  • Constrained trees. Each tree is symmetric (oblivious): every level applies one shared (feature, threshold) split. Each tree may use only a few distinct features, so the whole ensemble has a fixed maximum interaction order (up to 8th order).
  • Exact decomposition. Because of that structure, the trained ensemble can be rewritten as a functional-ANOVA (fANOVA) decomposition: one table per main effect and per interaction. The tables reproduce the model's predictions exactly, to floating-point tolerance.
  • Purification and pruning. The tables are centred on the training data (exposure-weighted when an exposure is given), so each main effect carries as much of the signal as it can. Tables that contribute little are pruned.
  • The tables are the model. A saved model is stored as its rating tables, so what you review is exactly what gets deployed.

It has a Rust core with Python bindings, takes polars DataFrames directly and is deterministic.

Install

uv add t-boost

To build from source you need a Rust toolchain; run uv sync.

Quickstart

import polars as pl
from t_boost import TBoostClassifier, TBoostRegressor

train = pl.read_parquet("policies.parquet")

# Claim frequency: Poisson with an exposure offset
freq = TBoostRegressor(objective="poisson").fit(
    train.select(FEATURES + ["ClaimCount", "Exposure"]),
    "ClaimCount",              # target, by column name
    exposure="Exposure",
)
rate = freq.predict(test)

# Classification: binary, or softmax for 3+ classes
clf = TBoostClassifier().fit(train.select(FEATURES + ["Lapsed"]), "Lapsed")
proba = clf.predict_proba(test)

Categorical columns are encoded automatically. At prediction time, columns are matched by name.

Rating tables and explanations

import json
tables = json.loads(freq.tables(train))                  # the fANOVA rating tables

freq.predict_contributions(test.head(5))                 # per-prediction breakdown by table
freq.feature_importances_                                # share of variance per feature
freq.actual_vs_expected(train, "ClaimCount", exposure="Exposure")   # A/E by factor level

For each prediction, base_value + sum(contributions) equals the raw (link-scale) score, so the explanation is exact rather than estimated. The output format matches rustystats' GLMModel.predict_contributions.

Saving and loading

with open("freq.tboost", "wb") as f:
    f.write(freq.to_bytes())

with open("freq.tboost", "rb") as f:
    loaded = TBoostRegressor.from_bytes(f.read())

to_json() / from_json() give a diffable format. A loaded model predicts identically to the original.

Objectives

Objective Use Link
squared_error regression identity
logistic binary classification logit
softmax (automatic for 3+ classes) multiclass softmax
poisson claim frequency / counts log
gamma severity log
tweedie pure premium log

License

Apache-2.0

Metadata

Release files for t-boost 0.8.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for t-boost 0.8.0
File Size Uploaded
t_boost-0.8.0.tar.gz 1.0 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for t-boost 0.8.0
File
t_boost-0.8.0-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details
t_boost-0.8.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 abi3 Linux glibc 2.17+ x86-64 Details
t_boost-0.8.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.10 abi3 Linux glibc 2.17+ ARM64 Details
t_boost-0.8.0-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details
t_boost-0.8.0-cp310-abi3-macosx_10_12_x86_64.whl CPython 3.10 abi3 macOS 10.12+ x86-64 Details

Total release size: 15.5 MB

Release files / t_boost-0.8.0.tar.gz

Download URL t_boost-0.8.0.tar.gz
Size 1.0 MB
Tags Source
SHA-256 checksum
How to use checksums
8accd06f78554a89c70b2180f2397387645ef06e1762d5f6c31a5632b169d8ae
BLAKE2b-256 checksum
How to use checksums
b99203458929783ef38c484bdb4025a1908f3fa02ae37c9624ec17051013a80f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 4, 2026.

Transparency log

Release files / t_boost-0.8.0-cp310-abi3-win_amd64.whl

Download URL t_boost-0.8.0-cp310-abi3-win_amd64.whl
Size 3.0 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
33da6113a3f03cf6bfe11422e367180a0a54a4bcc3de963aac48b1541e95a99d
BLAKE2b-256 checksum
How to use checksums
07ead9e91f96f4c3316265f4da1945589ba9b14db2035471e147adfb39c28fe4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 4, 2026.

Transparency log

Release files / t_boost-0.8.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL t_boost-0.8.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 3.1 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
97983e783e1ca7556d9f815bd94e7fa3c2b2f3f138589c8b314004551102deb9
BLAKE2b-256 checksum
How to use checksums
c3b64def521ee103349a519f6a4595f0dc90dabb11a62020b036fd749393a9e6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 4, 2026.

Transparency log

Release files / t_boost-0.8.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL t_boost-0.8.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 2.7 MB
Tags CPython 3.10 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
ecf5c219709bfd34c6b09a1b63f489f3e7f15382e4be307729757a96a798663d
BLAKE2b-256 checksum
How to use checksums
346f4e8fa996fe998695c556ac03fb39e0977f44cae24a10ce065608f60bc77f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 4, 2026.

Transparency log

Release files / t_boost-0.8.0-cp310-abi3-macosx_11_0_arm64.whl

Download URL t_boost-0.8.0-cp310-abi3-macosx_11_0_arm64.whl
Size 2.6 MB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
6e4ad03c2946a2b353c0faef01954e0c07c16ebe6cb5fd82fd9f3f8ce7e6ffed
BLAKE2b-256 checksum
How to use checksums
d73746241c13e69ef5ac7f440c9aebad44e9ab4d219c7ea4081380583a2fa650
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 4, 2026.

Transparency log

Release files / t_boost-0.8.0-cp310-abi3-macosx_10_12_x86_64.whl

Download URL t_boost-0.8.0-cp310-abi3-macosx_10_12_x86_64.whl
Size 3.0 MB
Tags CPython 3.10 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
c749bf90bb1747f7dcbe17476993813cc1bcec58ccce39219b1a1309bc6ec389
BLAKE2b-256 checksum
How to use checksums
2c36733283075410bbba691fcd21a87bbd10e0fe184d3fddf253d2445aa1ee17
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 4, 2026.

Transparency log

Release history Release notifications | RSS feed

0.8.1

6 release files

This release

0.8.0 This release

6 release files

0.7.0

6 release files

0.6.2

6 release files

0.6.1

6 release files

0.6.0

5 release 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