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.7.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.7.0
File Size Uploaded
t_boost-0.7.0.tar.gz 1.0 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for t-boost 0.7.0
File
t_boost-0.7.0-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details
t_boost-0.7.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.7.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.10 abi3 Linux glibc 2.17+ ARM64 Details
t_boost-0.7.0-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details
t_boost-0.7.0-cp310-abi3-macosx_10_12_x86_64.whl CPython 3.10 abi3 macOS 10.12+ x86-64 Details

Total release size: 15.4 MB

Release files / t_boost-0.7.0.tar.gz

Download URL t_boost-0.7.0.tar.gz
Size 1.0 MB
Tags Source
SHA-256 checksum
How to use checksums
df4c6127f6b555c300fa2513f0d8efe3e243a8b2353ef40d4cdadd055541ec4c
BLAKE2b-256 checksum
How to use checksums
7a3770d4166cdbc5ccc8aa93bac83170f3001918f5acea6eca544349f9a56c12
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.7.0-cp310-abi3-win_amd64.whl

Download URL t_boost-0.7.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
4c41d0d53882ddd7add394928550965afbf4027653c6cbd3e234cf2a32a0e542
BLAKE2b-256 checksum
How to use checksums
a8b29c63f36de2cd067a4ea836b30a4e4c4794516ac9f205d77b06b5743f44c7
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.7.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL t_boost-0.7.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
13b1d44863c71cb41547a009a32e2aaff4efc676bc99b19cc4bc33ed6c0691f4
BLAKE2b-256 checksum
How to use checksums
5998f294552b396887fcec2ba1c48b8cfe234cff19b2216b10d86e175696ae6a
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.7.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL t_boost-0.7.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
d722294baa69c35675d5803926b3418c79457b6a4f6ca21a30f5d115b634648b
BLAKE2b-256 checksum
How to use checksums
3756d657f20d15d6385039975062114632c051e2f24cac79a6aa0c0a69cc9ba6
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.7.0-cp310-abi3-macosx_11_0_arm64.whl

Download URL t_boost-0.7.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
fb3c7e2d97fd2a2be67e56710a496a3b8cdaefafa18fda52feae79a8b4da492e
BLAKE2b-256 checksum
How to use checksums
e1f738d258c57fedd922610eb3cb9231d2c31564b6f5cb8b255f46e0b940be7c
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.7.0-cp310-abi3-macosx_10_12_x86_64.whl

Download URL t_boost-0.7.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
f43515a2ec1a3e526100a570b47e6a42a3fbf17529f6a65725a4f9ebe94a5079
BLAKE2b-256 checksum
How to use checksums
0fbdbf0b583eaa47b814800a7ac34f767fd0d01be0a7b69b4071f330c7e7bd85
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

0.8.0

6 release files

This release

0.7.0 This release

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