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.6.2

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

Built distributions (wheels)

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

Total release size: 15.0 MB

Release files / t_boost-0.6.2.tar.gz

Download URL t_boost-0.6.2.tar.gz
Size 1.0 MB
Tags Source
SHA-256 checksum
How to use checksums
51db2491ef87c18aa2d0512aa9f9264c280bcb45cb402fdc9761976ff5c756f8
BLAKE2b-256 checksum
How to use checksums
11f0c691533281e9a8ce165b861180d2775e40c3a9d6c44bc2961129c567c0e3
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 3, 2026.

Transparency log

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

Download URL t_boost-0.6.2-cp310-abi3-win_amd64.whl
Size 2.9 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
bcea2e70fff0dc033352e7c034fd768fda7a5b3990fedf4de4ee07125719f72f
BLAKE2b-256 checksum
How to use checksums
05d9643cee586a8493f914e3072080235d6cb33d00dccf760b055db914223e6b
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 3, 2026.

Transparency log

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

Download URL t_boost-0.6.2-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 3.0 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
ffde9f2c1c18ca1a75eb18fe7cbdc1430c15b91c270d0004b470253ea3e512fe
BLAKE2b-256 checksum
How to use checksums
e1d942e8f3f135e48827a6c2d13000394f9aa0997889a89f3bd3a6edeb1a6eb3
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 3, 2026.

Transparency log

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

Download URL t_boost-0.6.2-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 2.6 MB
Tags CPython 3.10 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
f8ab57919b72cbb604da81c168e605ea57f9e73f3d0c4e19f01040696634b84c
BLAKE2b-256 checksum
How to use checksums
b65e13b87da7777d7b2b4a13145eacedb2587016bab71a251e2e31ba374ef5e3
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 3, 2026.

Transparency log

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

Download URL t_boost-0.6.2-cp310-abi3-macosx_11_0_arm64.whl
Size 2.5 MB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
095213c9d4391514d2ce1320c62d32ecd2de2456d6b7fe602025b4cbbcdc0d89
BLAKE2b-256 checksum
How to use checksums
f52d43b8cdf1a0c682d501ee0d1963b2be6adbebdb336f62678679bdd65abdc5
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 3, 2026.

Transparency log

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

Download URL t_boost-0.6.2-cp310-abi3-macosx_10_12_x86_64.whl
Size 2.9 MB
Tags CPython 3.10 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
b31b8fe6648aaf672d5c5b6572ad70abe49bc84aee6b601e267bb7eaf906eb63
BLAKE2b-256 checksum
How to use checksums
dc384c40d53b72ebe9a41fd82c2b51e145f849dcb93119998af8622e63b50b81
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 3, 2026.

Transparency log

Release history Release notifications | RSS feed

0.8.1

6 release files

0.8.0

6 release files

0.7.0

6 release files

This release

0.6.2 This release

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