Actuarial science and AI · Intermediate level · Mini-course 2 of 3

Predictive models with actuarial rigor

A model that predicts the training data very well can fail on new data. This mini-course covers what separates a useful model from one that memorizes: splitting data, measuring with deviance, validating out of sample, explaining and checking fairness.

35 min
Estimated time
4
Lessons
5
Questions
ObjectivesLessonsWorked exampleSelf-assessmentReadings
01

Objectives

By the end of this mini-course you will be able to:

  • Split data into training, validation and test sets.
  • Compute and compare the Poisson deviance of two models.
  • Recognize overfitting by comparing in-sample and out-of-sample results.
  • Explain why explainability, fairness and data quality are part of the job.
02

Lessons

Lesson 1

Train, validate and test

Data are split: one part trains the model, another tunes its settings, and a third, which the model never saw, measures real performance.

\[\text{data}=\text{training}\;\cup\;\text{validation}\;\cup\;\text{test}\]

Measuring only on training data rewards memorization.

Lesson 2

Poisson deviance

For claim frequencies, the Poisson deviance measures how far predictions \(\mu_i\) are from observations \(y_i\). Lower is better:

\[D=2\sum_i\left[y_i\ln\frac{y_i}{\mu_i}-(y_i-\mu_i)\right]\]

When \(y_i=0\), the first term is zero.

Lesson 3

Explaining the model

Explainability techniques, such as SHAP values and partial dependence plots, show how much each variable contributes. Without them, a complex model is hard to defend to a client or a regulator.

\[\hat y=\phi_0+\sum_j\phi_j\]

SHAP values split the prediction among the variables.

Lesson 4

Fairness and data quality

A variable can act as a proxy for a characteristic that should not be used. And a model is no better than its data. The U.S. modeling standard of practice, ASOP 56, applies since October 2020, and the data quality standard, ASOP 23, since April 2017.

\[\text{quality data}\;+\;\text{suitable model}\;+\;\text{correct use}\]

Both standards come from the U.S. Actuarial Standards Board; in Mexico they serve as a reference for good practice.

03

Worked example

Six policies with observed claims of 0, 1, 0, 2, 0 and 1 in one year. Model A predicts the mean, 0.667, for all of them; model B uses their characteristics and predicts 0.3, 0.9, 0.4, 1.6, 0.3 and 0.9. A third model C memorizes: it predicts exactly what was observed. The next year the same policies have 1, 0, 0, 1, 0 and 2 claims.

Step 1. Deviance on the training data

\[D_A=6.02,\qquad D_B=2.11,\qquad D_C\approx0\]

Step 2. Deviance in the following year

\[D_A=6.02,\qquad D_B=5.46,\qquad D_C=10.66\]

Step 3. The lesson

\[\text{B wins out of sample; C, which memorized, is the worst}\]

In sample, model C looks perfect. Out of sample it is the worst, at 10.66, because it learned the noise of the observed year. Model B beats the mean on new data too: it learned something from the characteristics. For C, a floor of 0.01 was used on zero predictions.

Remember: A model is judged on data it has not seen. Out-of-sample deviance, explainability and fairness review are not optional steps: they are the actuarial work.
04

Self-assessment

Choose one answer per question: you will see right away whether it is correct and why. At the end, check your score. Nothing is stored or sent.

1. What is the test set for?
2. In the example, which model has the lowest out-of-sample deviance?
3. What does near-zero training deviance and very high test deviance indicate?
4. What do SHAP values do?
5. Since when does the modeling standard ASOP 56 apply?
05

Readings

Official sources and reference texts. The numerical examples are illustrative.

On actuaria.mx

PreviousWhere they meetNextGovernance and path