Basis Lab

The Simplest Model That Learns

The Answer Without Any Steps

Last timeWhich Way to Turn the Knobs

For a straight line and the squared score the best knobs can be written down directly, and understanding why that shortcut exists explains why almost nothing else has one.

The bottom of a bowl has no slope

Walk downhill on a bowl and the walking stops where the ground is level.

That is not a coincidence of bowls, it is what being the lowest point means:

anywhere with a slope has a downhill direction, so it is not the lowest.

So the lowest point of the score is wherever both slopes are zero. The

previous lesson has already written both slopes down. Setting them to zero

gives two equations, and two equations in two unknowns can be solved

directly, with no walking at all.

FIG 1The condition at the bottom
the slope knob, now the unknown rather than a current setting
the offset knob, likewise
the input and the true value of example i, all of them known numbers
The data appears only inside sums, which can all be computed in one pass over the examples. That is the key to the shortcut: however many examples there are, these equations have the same two unknowns, and the whole data set enters as a handful of totals.

The right hand equation says something readable on its own. It says the errors

must add to zero, which means the fitted line passes exactly through the

average of the data. Whatever the slope turns out to be, the line pivots about

that one point.

Solving them

Use the second equation to express the offset in terms of the slope, put it

into the first, and the slope falls out.

The lesson stops here

4 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 Stepsyou are here
  5. 05More Than One Inputopening only
  6. 06Predicting Yes or Noopening only
  7. 07When It Learns the Noiseopening only
  8. 08The Same Four Parts, Much Biggeropening only

Read alongside