Skip to content

linear regression

learning

Level 2 of 3

Also called linear regression by gradient descent, least squares line fitting and gradient descent.

fresh numbers

The test's questions that a run answers, asked again on new numbers whenever you like. The answer, its working and the reason for every other choice come from linear regression's own run on the numbers shown.

choose one

question 1

Five points, 0 7, 3 8, 4 1, 9 6 and 10 5, step size 0.29 and 7 steps. No step raises the loss. How many misses are measured in all?

0246810024681001234567
the answer, and why

the answer is A

The line is measured 8 times, once before any step and once after each of the 7. Each measure finds 5 misses.

if you chose another

  • That counts 7 measures, leaving out the one before any step.
  • That is how many times the line is measured, not how many misses.
  • That is one measure only.

new numbersthe test page's numbers

question 2

Four points, 1 1, 7 1, 8 1 and 10 1. The line starts flat at height 5. What is the loss before any step?

024681002468100123456
the answer, and why

the answer is D

Every miss is 1 minus 5, which is minus 4. Each square is 16, so their mean is 16.

if you chose another

  • That adds the four squares without sharing them among the points.
  • The points lie on one line, but not on this one yet. It starts at height 5.
  • That is one miss. A loss squares it, so it is never below 0.

new numbersthe test page's numbers