Applied Actuarial Data Science

Python for Actuaries

Hands-on, downloadable Jupyter & Google Colab notebooks designed for modern actuarial analysts and candidates. Master non-life claims reserving, GLM pricing, and statistical simulations in pure Python.

Coming Soon · All-Access Pro Feature
Coming Soon · Pro Non-Life Reserving

ChainLadder Reserving & Mack Bootstrap IBNR

Load historical paid and incurred triangle data, calculate age-to-age loss development factors (link ratios), fit tail factors, and simulate standard errors of IBNR reserves using the Mack bootstrap method.

# Python Reserving Pipeline import chainladder as cl triangle = cl.load_dataset('clrd').groupby('LOB').sum() model = cl.Chainladder().fit(triangle['wkcomp']) ibnr = model.ibnr_ print(f"Total Portfolio IBNR: £{ibnr.sum():,.2f}")
Key libraries: chainladder-python, pandas, numpy, matplotlib
Coming Soon · Pro General Insurance Pricing

GLM Frequency & Severity Claim Pricing

Fit Poisson claim frequency models with offset=log(exposure), Gamma claim severity models with log link, and Tweedie compound Poisson models directly in Python using Statsmodels.

# Python GLM Pricing Model import statsmodels.api as sm import statsmodels.formula.api as smf formula = "claims ~ C(driver_age) + C(vehicle_group)" glm = smf.glm(formula, data=df, family=sm.families.Poisson(sm.families.links.Log()), offset=np.log(df['exposure'])).fit() print(glm.summary())
Key libraries: statsmodels, scipy, scikit-learn, seaborn
Coming Soon · Pro Machine Learning

Gradient Boosted Trees & SHAP Explanations

Train XGBoost models with Poisson objective functions on insurance exposure data, perform hyperparameter tuning with cross-validation, and extract SHAP value explanations for actuarial pricing governance.

# XGBoost Actuarial Objective import xgboost as xgb import shap dtrain = xgb.DMatrix(X, label=y, weight=exposure) params = {'objective': 'count:poisson', 'eval_metric': 'poisson-nloglik'} model = xgb.train(params, dtrain, num_boost_round=150) explainer = shap.TreeExplainer(model)
Key libraries: xgboost, lightgbm, shap, optuna