Skip to main content

Azoic — Actuarial modelling, from models to tariffs

Azoic

Non-life technical tariff and pure-premium modelling, inspectable by design.

PyPI version Documentation CI status MIT license

Website & docs →

First model · Tutorial · PyPI · GitHub

Azoic is a scikit-learn-compatible Python toolkit for non-life technical tariff and pure-premium modelling. It keeps actuarial preprocessing, GLM (glum) and GBM (LightGBM) fitting, frequency–severity decomposition, ranking and calibration diagnostics, reproducible experiment runs, and multiplicative tariff export in one explicit workflow.

Azoic means "without life." The name points to non-life insurance.

Install

Azoic 0.7.0 requires Python 3.12 or newer and pandas 3.0 or newer.

With uv:

uv add azoic==0.7.0
uv run azoic --help

With pip:

python -m pip install azoic==0.7.0
azoic --help

Azoic is pre-1.0: minor releases can include documented compatibility changes. Pin a version for production work and read the changelog before upgrading. Earlier releases remain installable, but this README and the documentation target 0.7.0.

First model

New here? The first-model guide generates a synthetic portfolio, compares a Tweedie GLM with a raw-feature GBM, and exports the fitted GLM to Excel. It needs no checkout, external data, or Quarto.

The guide builds train and validation frames. The core API shape is:

from azoic.metrics import calibration_table, gini, op_ratio
from azoic.models import RiskGLM
from azoic.tariff import export_tariff

features = ["driver_age", "vehicle_age", "region"]
glm = RiskGLM(family="tweedie", link="log", exposure_col="exposure", tweedie_power=1.5)
glm.fit(train[features + ["exposure"]], train["claim_amount"] / train["exposure"])
rates = glm.predict(validation[features + ["exposure"]])

gini(validation["claim_amount"], rates, validation["exposure"])
op_ratio(validation["claim_amount"], rates, validation["exposure"])
calibration_table(validation["claim_amount"], rates, validation["exposure"])
export_tariff(glm, "tariff.xlsx", recalibrate=False)

Why Azoic

  • Actuarial preprocessing. AutoBinner and AutoGrouper learn inspectable strata and category groups with native LightGBM trees, missing routing, credibility floors, and fixed mappings that survive refits.
  • GLM, GBM, and frequency–severity in one vocabulary. RiskGLM (glum), RiskGBM (LightGBM), and FrequencySeverityModel share scikit-learn fit/predict semantics and pure-premium rate targets.
  • Diagnostics that pair ranking with calibration. Gini and Lorenz curves, lift, calibration tables, one-way and double-lift views, temporal stability, and observed/predicted ratios.
  • Reproducible runs. ExperimentConfig, run_experiment, save_run and load_run keep data contracts, preprocessing, split membership, versions, and fitted candidates together.
  • Tariff operations, not only fitting. GBM-to-GLM distillation, structural or recalibrated workbook export, controlled revisions, tariff review, final-test evaluation, and versioned production bundles.
  • Agent skills included. The package ships modelling, diagnostics, and tariff skills for compatible agents; see the agent skills guide.

Four correctness rules

  1. Exposure is a weight, not an offset. Model pure-premium rates with y = claim_amount / exposure and sample_weight = exposure; the configured exposure_col does this inside X. Add log(exposure) as an offset only when the target is aggregate claim amount, never both.
  2. Frequency and severity stay separate. Frequency models use claim_count / exposure with Poisson and exposure weights. Severity models fit only rows with claim_count > 0, using Gamma on positive average claim amounts; FrequencySeverityModel applies that filter internally.
  3. Ranking is not calibration. Gini and Lorenz measure concentration, with tied scores aggregated before integration. They say nothing about rate level, so always pair them with a calibration table and the observed/predicted ratio.
  4. Evaluation boundaries are explicit. Temporal splits keep equal timestamps together. Tune on an inner split of training data, reserve final test records before experimenting, and evaluate that final test once. Keep development validation, final evidence, and production refit distinct.

Documentation

Start

Guides

Tutorial

Reference

Project

Scope

Azoic models claim frequency, severity, and pure-premium technical tariffs. It is not a reserving, fraud, policy-administration, or AutoML system.

Development

See Contributing for checkout setup, checks and documentation commands.

License

MIT. Copyright (c) 2026 Thomas Bury. See LICENSE.

Metadata

Release files for azoic 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 azoic 0.7.0
File Size Uploaded Provenance Actions
azoic-0.7.0.tar.gz 101.5 kB With provenance Details for azoic-0.7.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for azoic 0.7.0
File Interpreter ABI Platform Actions
azoic-0.7.0-py3-none-any.whl Python 3 none any Details for azoic-0.7.0-py3-none-any.whl

Total release size: 216.8 kB

Release files / azoic-0.7.0.tar.gz

Download URL azoic-0.7.0.tar.gz
Size 101.5 kB
Tags Source
SHA-256 checksum
How to use checksums
bee4a1746ac9484605c2366c5670e0b906f88a4fbcb8e5bb8e1061e879dbac08
BLAKE2b-256 checksum
How to use checksums
9cd9afadf7e301efc6e2a123edb062b4544f253646104b636000e2e65ff70a38
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 Nov 18, 2026.

Transparency log

Release files / azoic-0.7.0-py3-none-any.whl

Download URL azoic-0.7.0-py3-none-any.whl
Size 115.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bb93a2590352e6b1ad6807e89601593567811d3d28885467e1b81c95e0c6472c
BLAKE2b-256 checksum
How to use checksums
94238df30ce3515ff950ebe5225508f1961af7d5ede59f84ee3b3817555ff1f5
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 Nov 18, 2026.

Transparency log

Security for azoic 0.7.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for azoic-0.7.0.tar.gz

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 Nov 18, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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