Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

actuarialnam

Latest version: v0.3.0

Overview

Last scanned
1 Dec 2026
Published
1 Dec 2026
PyPI package Publisher: plaub
2 Stars
0 Forks
1 Versions
Python Repo language

Scan summary

actuarialnam was last scanned on 1 Dec 2026 at version 0.3.0. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: First and only release on 1 Dec 2026.
  • Findings: No rules fired in version 0.3.0.

Versions

1 version published
Versions and the rules that fired in each
VersionPublishedStatus
0.3.0 LATEST 1 Dec 2026 No rules fired

No rules fired in 0.3.0

Findings

Findings for v0.3.0. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 0.3.0; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

actuarialnam

The Actuarial Neural Additive Model (ANAM): an interpretable deep learning model for general insurance pricing, written in PyTorch.

from actuarialnam import ANAM   # pip install actuarialnam

Like a GAM, the model adds up one shape function per rating factor, plus a few selected pairwise interactions:

g(mu) = bias + f_1(x_1) + ... + f_p(x_p) + sum of selected f_jk(x_j, x_k) + offset

Each shape function is a small neural network, so it learns its shape from the data, yet every term can still be plotted and read on its own. On top of this additive structure the package adds the requirements of a pricing model:

  • Sparsity: a three-stage selection procedure keeps only the material main effects and interactions.
  • Smoothness: a roughness penalty keeps continuous effects from overfitting.
  • Monotonicity: a factor such as a bonus-malus score can be forced to only increase (or decrease), using lattice subnetworks that guarantee it everywhere, not just on the training data.
  • Exposure: an offset column, exactly as in a Poisson GLM.

It supports Poisson, gamma and Gaussian responses. This is the reference implementation of the model in Laub, Pho & Wong (2026).

Install

pip install actuarialnam

or, for the development version:

pip install "actuarialnam @ git+https://github.com/Pat-Laub/anam.git"

It needs Python 3.12 or newer.

Quickstart

The model takes the raw data frame. Continuous and categorical columns are read from the dtypes, and the standardising and encoding are stored in the model, so predict and the plots work in the original units.

from actuarialnam import ANAM

model = ANAM(
    distribution="poisson",         # log link and Poisson loss
    exposure="expo",                # log(expo) is added as an offset
    monotone={"bm": "increasing"},  # bonus-malus effect can only increase
    smoothness=1e-3,                # roughness penalty on continuous effects
)

# By default, fit() selects the main effects and interactions, then fits them.
model.fit(X_train, y_train, X_val=X_val, y_val=y_val,
          epochs=300, batch_size=5000, lr=0.01, patience=40, random_state=2000)

model.features_, model.interactions_   # the selected terms
model.predict(X_test)                  # expected claim counts, exposure included

Choosing the terms yourself

Rather than trusting the automatic cutoffs, you can look at the rankings and then decide:

model.rank_main_effects(X_train, y_train, X_val=X_val, y_val=y_val, random_state=2000)
model.plot_main_effect_importance()

model.rank_interactions(X_train, y_train, X_val=X_val, y_val=y_val,
                        n_main=7, random_state=2000)
model.plot_interaction_importance()

model.choose(n_main=7, n_interactions=6)
model.fit(X_train, y_train, X_val=X_val, y_val=y_val,
          epochs=300, batch_size=5000, lr=0.01, patience=40, random_state=2000)
  • rank_main_effects trains an ensemble of small main-effect models and scores each factor by how much its shape function varies over the data.
  • rank_interactions scores each pair of kept main effects by how much it improves the validation loss.
  • choose fixes the cutoffs, and fit then trains the chosen terms with the smoothness and monotonicity constraints.

Reading the model

Each shape function is a contribution to the linear predictor. Under a log link, exp(f_j) is a multiplier on the expected claim count.

model.plot_effects(["ageph", "bm", "power"])   # several main effects
model.plot_effect("fuel")                      # a categorical factor, one bar per level
model.plot_effect("long", "lat")               # an interaction surface
grid, values = model.effect("bm")              # the numbers behind a plot
model.predict_components(X_test)               # each term's contribution, per policy
model.importance()                             # variance of each term over the data

Saving and loading keeps the preprocessing:

model.save("model.pt")
model = ANAM.load("model.pt")

Categories not seen in training get zero effect.

Development

git clone https://github.com/Pat-Laub/anam.git
cd anam
uv run pytest

Citation

@article{laub2026anam,
  title   = {An interpretable deep learning model for general insurance pricing},
  author  = {Laub, Patrick J. and Pho, Tu and Wong, Bernard},
  journal = {Insurance: Mathematics and Economics},
  year    = {2026},
  pages   = {103270},
  doi     = {10.1016/j.insmatheco.2026.103270},
}

License

MIT

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • pypi-releases actuarialnam

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Powered by Read the latest findings

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

Microsoft's Official agent framework Hijacked
AI & VibeSec

BREAKING: Hijacked Releases of Microsoft’s Official agent-framework Steals Azure and CI Credentials

The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Vulnerability Insights

The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?

Copy of Template Design OX Blog (2)
Research

NGINX2Root: Five Critical NGINX Flaws Expose Web Servers to Remote Code Execution

Frame 2085668439 (1)
Group 1261154229