superglm#

Super GLM
Penalised GLMs and GAM pricing models for insurance, with the smoothness chosen by REML and the constraints you would otherwise enforce by hand.
Get started Tutorials
Get started
Install, then the quick start: which fit to call, and how to read the summary it prints.
Tutorials
Executed notebooks you can open in Colab. First, a distributional model; pricing tutorials on French motor data follow.
How-to guides
One goal per page: choosing a fit path, features and levels, constraints, screening, validation, deployment.
Explanation
Why REML, what weights mean, how credibility becomes smoothing, what screening can and cannot detect.
Twelve lines to a fitted model#
from superglm import Categorical, Numeric, Spline, SuperGLM
features = {
"DrivAge": Spline(kind="ps", k=14, knot_strategy="quantile_rows"),
"VehAge": Spline(kind="cr", k=10, knot_strategy="quantile_rows"),
"BonusMalus": Spline(kind="cr", k=12, knot_strategy="quantile_tempered"),
"Area": Categorical(base="most_exposed"),
"LogDensity": Numeric(),
}
model = SuperGLM(family="poisson", features=features)
model.fit_reml(df, y, sample_weight=exposure)
print(model.summary())
Why the fitted curves look the way they do: How REML chooses smoothness.
The API reference documents every public name. The governance section is for model-risk reviewers.