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.6.1 requires Python 3.12 or newer and pandas 3.0 or newer.

With uv:

uv add azoic==0.6.1
uv run azoic --help

With pip:

python -m pip install azoic==0.6.1
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.6.1.

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

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.6.1
File Size Uploaded Provenance Actions
azoic-0.6.1.tar.gz 98.7 kB With provenance Details for azoic-0.6.1.tar.gz

Built distribution (wheel)

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

Total release size: 211.0 kB

Release files / azoic-0.6.1.tar.gz

Download URL azoic-0.6.1.tar.gz
Size 98.7 kB
Tags Source
SHA-256 checksum
How to use checksums
8c81f3d84036767e92c60b4a1058946d2c08f9ddc0da8ea9df671f3fe281d640
BLAKE2b-256 checksum
How to use checksums
69550e95f5cee3a953a8c68914b4ac08982a4c8defa3d7e044f25ee7d19421fa
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 12, 2026.

Transparency log

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

Download URL azoic-0.6.1-py3-none-any.whl
Size 112.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f5fa7a007dcce04dfc15aed0a844bae242977b2ddd64a74d45b1c7e99db09eb3
BLAKE2b-256 checksum
How to use checksums
8612aec45cc83664155a00c20a72b1ef322277a0145080f84762c699565780f4
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 12, 2026.

Transparency log

Security for azoic 0.6.1

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.6.1.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 12, 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