Practice

Basics of Statistical Learning

Judge a model by its test error, not its training error. More flexibility always lowers training error; test error falls, then rises as variance takes over.

A lesson for this topic

Question 1

A claim-triage classifier has sensitivity 80% and specificity 90% for detecting claims that will exceed the reinsurance retention. Of all claims, 5% exceed the retention.

Calculate the precision of the classifier: the proportion of claims it flags that actually exceed the retention.

Question 2

An actuary fits a logistic regression of whether a policy filed a claim on its annual mileage, using 12 policies. The fitted claim probabilities are below.

PolicyAnnual mileage (000s)Claim filedFitted probability
15No0.160
27No0.203
38Yes0.228
410No0.283
511No0.314
613Yes0.379
714No0.414
816No0.486
917Yes0.523
1019Yes0.595
1121No0.663
1224Yes0.753

The actuary predicts a claim for every policy whose fitted probability exceeds 0.40.

Calculate the training sensitivity of this classifier.

Question 3

A K-nearest neighbors classifier with K = 3 predicts whether a policyholder lapses from the number of years they have been insured, with distance measured as the absolute difference in years. The training data are:

Years insured12457810111315
OutcomeLapsedLapsedStayedLapsedLapsedStayedStayedLapsedStayedStayed

The classifier is applied to eight test policyholders:

Years insured1.63.54.46.89.410.612.314.2
OutcomeLapsedLapsedStayedStayedStayedLapsedLapsedStayed

Calculate the test error rate of the classifier.

Question 4

A model predicts claim severity, in thousands. At a particular predictor value x0x_0, the estimate f^(x0)\hat f(x_0) has bias −0.6 and variance 0.45 over repeated training sets, and the irreducible error has variance 1.20.

Calculate the expected test MSE at x0x_0.

Question 5

In a simulation study the true regression function at x0x_0 is  and the error variance is  . A model is fitted to five training sets, giving these estimates of f(x0)f(x_0):

5.6, 4.8, 6.1, 5.3, 5.7

Treat the five estimates as the whole distribution of f^(x0)\hat f(x_0) over training sets, each with probability 0.2.

Calculate the expected test MSE at x0x_0.