Home/Selected work/Policy retention

Insurance · Predictive modeling · 2026

Policy Retention Modeling

An insurance cancellation workflow that joins policy history with geographic, disaster-risk, rurality, and crime context while keeping validation strictly time-aware.

PythonLightGBMXGBoostOptunaGeospatial
CompetitionNESS Statathon
Target3 cancellation states
Model familiesLightGBM + XGBoost
ValidationYear-aware splits

Predict cancellation without leaking the future.

Insurance records arrive over time, so a random train-test split can make performance look better than it will be in practice.

The project predicts policy cancellation status from historical policy records. The central design choice was to preserve chronology, fit preprocessing only on training data, and enrich policies with external context that would have been knowable at the prediction date.

Competition setting

Built for the 2026 New England Statistics Symposium Statathon, with reusable preprocessing, model comparison, and tuning code rather than a single notebook-only submission.

Policy records in geographic context.

Policy

Customer and property

Age, premium, tenure, residence length, household composition, coverage, dwelling type, and claims.

RUCA

Rural–urban context

ZIP-level commuting-area codes and derived urban/rural groupings.

FEMA

Hazard and expected loss

County-level flood, hurricane, wildfire, wind, winter-weather, and earthquake measures.

NIBRS

Crime context

Prior-year county burglary, theft, vehicle theft, property crime, and arson rates.

External joins used by the workflow
SourceJoin levelExamplesTiming rule
RUCA 2020ZIPPrimary RUCA, urban/rural classStatic context
FEMA National Risk IndexCounty/FIPSRisk, expected loss, hazard fieldsVersion recorded per run
NIBRSCounty-yearProperty and theft ratesPrefer policy year − 1

A fitted transformer, not ad hoc cleaning.

01Chronological split
02Train-only preprocessing
03Boosted-tree models
04Optuna tuning
01

Handle missingness

Learn numeric medians on training data, add missingness indicators, and map unseen categories to “Other.”

02

Stabilize the schema

Persist feature names and ordering so validation and test matrices exactly match training.

03

Control cardinality

Keep state directly, group rare state–city pairs, and expose post-transform feature dropping.

04

Compare models

Run LightGBM and XGBoost helpers with validation metrics, saved seeds, feature toggles, and submission generation.

The durable result is the modeling pipeline.

The repository contains a fit/transform preprocessor, LightGBM and XGBoost training helpers, Optuna tuning, county-crime feature construction, detailed preprocessing documentation, and lightweight automated syntax checks.

Leakage controlTrain only

Medians, vocabularies, and schemas never learn from validation or test

Context layers3 sources

RUCA, FEMA, and NIBRS enrichment

Deployment artifactSaved

Fitted preprocessing can be serialized and reused for scoring

No performance numbers are invented here.

Competition data and outputs are not committed.

The public repository intentionally excludes raw competition files, trained models, logs, submissions, and generated artifacts. Because final evaluation results are not versioned publicly, this page documents the methodology and implementation without claiming an accuracy, rank, or business lift.

Next case studyBikeRentalData