Skip to main content

EasyGLM

EasyGLM is a python package that makes fitting regularised generalised linear models (GLMs) for use in general insurance pricing a cinch. It produces factor relativity tables to inspect, amend and use in a way that naturally fit into standard pricing workflows. It can be used both programmatically within a python session or in the local browser using the GUI workbench.

Install

Requires Python 3.10–3.14. The installation includes the local workbench and CatBoost.

python -m pip install --upgrade easy-glm

Install as easy-glm; import as easy_glm.

Use the workbench

easy-glm-workbench

The workbench opens in your browser and runs locally. Keep the terminal open while you work.

In Project & data, load your data, choose a single model or a sequence of models, and assign the target and any exposure, weight, ID or train/test columns. Choose the model family and predictors. For GLM numeric factors, use automatic bands, set your own cuts or choose a curve, then fit the model.

Inspect the relativities and A/E, search for missing factors or interactions, and compare candidate models. You can amend rates, preview the effect of a change before applying it, and export the tables to Excel.

The workbench walkthrough shows this process on screen.

Use it from Python

PricingSession keeps the data, target, exposure, split and band settings together while you build models. Each fit returns a named model you can inspect, compare or build on.

This example fits driver age and vehicle age to the public French motor claim-frequency data. EasyGLM downloads the data and caches it for later use.

from easy_glm import PricingSession, load_external_dataframe

data = load_external_dataframe().sample(n=10_000, seed=42)

study = PricingSession(
    data,
    family="poisson",
    claims="ClaimNb",
    exposure="Exposure",
    id="IDpol",
)
model = study.fit_glm("Age model", factors=["DrivAge", "VehAge"])

model.summary()
model.relativities("DrivAge").show()
model.ae("DrivAge").show()

The session creates a 70/30 train/holdout split, keeping rows with the same ID together. Fitting and searches use training data; the A/E above is also on training data. Earlier named fits remain available when you change bands or fit another model.

Export the tables and save the fitted model:

model.to_excel("age_model.xlsx")
model.save("age_model.easyglm")

To open the same data in the workbench:

import easy_glm

easy_glm.launch_workbench(data=data)

The pricing walkthrough continues with custom bands, missing-factor searches, interactions, rate amendments and holdout validation.

Add interactions or further models

Add and review interaction tables after fitting the main effects. Each new interaction uses the GLM and earlier tables as its offset, keeping their rates fixed.

You can also fit CatBoost on its own or combine GLMs and CatBoost in a sequence. Each model has its own predictors and uses the complete prediction from all earlier models as its offset. Sequential models support Poisson, Tweedie and Gaussian with a log link.

See the model workflow examples for different orders and tuning settings. The model family examples cover severity, pure premium and claim occurrence.

Save and score

A saved fitted model reuses the rates without refitting. In the workbench you can also export the project settings and a Python script that repeats the fits.

In Score on new data, select the new data and the saved model or sequence to apply. Check the required columns, score the data, and download the results as CSV or Parquet. The scoring example shows this in Python and the workbench.

All examples and workflows · Changelog

Why I built this

This started with my wish to port R's aglm to Python and give it a GUI. It's built primarily for my own pricing work and will be buggy, because… vibecode yo. Check the results before using them.

MIT licence.

Metadata

Release files for easy-glm 0.473

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for easy-glm 0.473
File Size Uploaded
easy_glm-0.473.tar.gz 1.0 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for easy-glm 0.473
File Interpreter ABI Platform
easy_glm-0.473-py3-none-any.whl Python 3 none any Details

Total release size: 1.8 MB

Release files / easy_glm-0.473.tar.gz

Download URL easy_glm-0.473.tar.gz
Size 1.0 MB
Tags Source
SHA-256 checksum
How to use checksums
be741dc8c78cdf41693765c1035f924e6bfef2977fde399c6060ac55deda37f7
BLAKE2b-256 checksum
How to use checksums
f5469776f1eb0992a07165f3aac49c450110cbd2f9534453f524a0adb61d7d00
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 11, 2026.

Transparency log

Release files / easy_glm-0.473-py3-none-any.whl

Download URL easy_glm-0.473-py3-none-any.whl
Size 781.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
20efc308c2ea8ff842832fda3895e22cc93930b4cdc62178613e00ffa2d0ebad
BLAKE2b-256 checksum
How to use checksums
0d6096a3d3f1dff572b74c470665c18815cc63ccd61a88caaab8e2ad1fdcab5e
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 11, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.473 This release

2 release files

0.472

2 release files

0.471

2 release files

0.470

2 release files

0.464

2 release files

0.463

2 release files

0.462

2 release files

0.461

2 release files

0.460

2 release files

0.452

2 release files

0.451

2 release files

0.4.5

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.2

2 release files

0.2.0

2 release files

0.1.0

2 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