Azoic
Non-life technical tariff and pure-premium modelling, inspectable by design.
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.2 requires Python 3.12 or newer and pandas 3.0 or newer.
With uv:
uv add azoic==0.7.2
uv run azoic --help
With pip:
python -m pip install azoic==0.7.2
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.2.
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.
AutoBinnerandAutoGrouperlearn 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), andFrequencySeverityModelshare scikit-learnfit/predictsemantics 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_runandload_runkeep 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
- Exposure is a weight, not an offset. Model pure-premium rates with
y = claim_amount / exposureandsample_weight = exposure; the configuredexposure_coldoes this insideX. Addlog(exposure)as an offset only when the target is aggregate claim amount, never both. - Frequency and severity stay separate. Frequency models use
claim_count / exposurewith Poisson and exposure weights. Severity models fit only rows withclaim_count > 0, using Gamma on positive average claim amounts;FrequencySeverityModelapplies that filter internally. - 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.
- 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
- Actuarial workflow
- Data profiling and preprocessing
- Model choice and fitting
- Experiments and CLI
- Diagnostics and visualization
- Reporting and operations
Tutorial
Reference
- Configuration and CLI
- Data and preparation
- Models and evaluation
- Compatibility and composition
- Workflow and operations
- Glossary
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.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| azoic-0.7.2.tar.gz | 101.6 kB | With provenance | Details for azoic-0.7.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| azoic-0.7.2-py3-none-any.whl | Python 3 | none | any | Details for azoic-0.7.2-py3-none-any.whl |
Total release size: 217.0 kB
Release files / azoic-0.7.2.tar.gz
| Download URL | azoic-0.7.2.tar.gz |
|---|---|
| Size | 101.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6092d8cbfc1ef0a56374fca40d63e048cfda4913390e376ab0f7c921ea570e19
|
|
BLAKE2b-256 checksum How to use checksums |
4735a0984757ee6fe828d9402af8a884a2d9f50079a252cb421968a64918dcff
|
| 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 19, 2026.
Transparency logRelease files / azoic-0.7.2-py3-none-any.whl
| Download URL | azoic-0.7.2-py3-none-any.whl |
|---|---|
| Size | 115.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4c34672120f7ee0c7ef0c04ca9917987630cc9d4cfc350dfcaa2676b8a6926d3
|
|
BLAKE2b-256 checksum How to use checksums |
843202c480438aae934c6b30178a47876cdc4f2b92fff786397c103059daf6b2
|
| 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 19, 2026.
Transparency logSecurity for azoic 0.7.2
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.
Attestation for azoic-0.7.2.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 19, 2026.
Transparency logA 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.