Basis Lab

The Simplest Model That Learns

When It Learns the Noise

Last timePredicting Yes or No

A model with enough knobs will fit the accidents in its training data, and the cure is to hold the knobs back with a penalty and to measure on data the fitting never saw.

A model that is too good

Take ten data points that follow a gentle curve with a little measurement

error. Fit a straight line and it misses, because the relationship is curved.

Fit a model with ten knobs, using the input, its square, its cube and so on,

and it passes through every point exactly. The training score is zero.

It is also useless. Between the points it swings violently, and asked about

an input slightly beyond the data it returns something absurd. It has fitted

the measurement error, which is to say it has learned the accidents of these

particular ten observations as though they were the relationship.

FIG 1Two fits to the same ten noisy points
0.003.136.259.3812.500.02.55.07.510.0input
a line: misses the curvenine knobs: passes through everything
The wiggling curve has the better training score by a wide margin and is the worse model by a wider one. Between the points it is nowhere near the truth, and what it does past the right hand edge does not bear repeating.

This is the central failure of the whole field and it has a particular shape.

Add flexibility and the training score falls, always, without limit. The score

on data the model has not seen falls at first, because real structure is being

captured, and then rises, because accidents are being captured instead.

FIG 2The two scores as flexibility increases
0.003.757.5011.2515.001.04.37.510.814.0number of knobs
on the data it was fitted toon data it has never seen
The two curves lie on top of each other at the left, where the model is too simple for both. They separate from about five knobs onwards. The bottom of the upper curve is the model to want, and nothing visible in the lower curve marks that point.

Holding data back

The gap in that picture is only visible because there were two scores. With

one, it is invisible.

So data must be held back: fit on part of it and measure on the rest. The held

back part has to be chosen before anything else happens, and then genuinely

not used. Not looked at while choosing which inputs to include, not used for

choosing the step size, not peeked at to see how things are going.

The reason for that severity is that any use at all is a form of learning from

it. A person who tries twenty settings and keeps whichever scored best on the

held back data has fitted that data by hand, and its score is now optimistic

in exactly the way the training score was. The standard arrangement has three

parts: one for fitting, one for choices made by hand, and one opened once at

the end.

The lesson stops here

6 more paragraphs to go

You have read the opening. The rest of the argument, the problems that check whether it landed, and the lines worth keeping at the end all come with a plan.

The first lesson of every course in the library reads the whole way through, free, so you can see exactly what the rest of them are.

See the planThe contents

This is the reading half

Starting the course gives you your own copy of it. Every idea on every page has problems standing under it, marked with a reason rather than a tick, and any sentence you do not believe can be opened and argued with. None of that can happen on a page nobody owns.

The contents

The rest of this course

  1. 01A Guess With Knobs On It
  2. 02Measuring How Wrong It Isopening only
  3. 03Which Way to Turn the Knobsopening only
  4. 04The Answer Without Any Stepsopening only
  5. 05More Than One Inputopening only
  6. 06Predicting Yes or Noopening only
  7. 07When It Learns the Noiseyou are here
  8. 08The Same Four Parts, Much Biggeropening only

Read alongside