Tensor by Tensor

02.01 · UNIT 01 · Regression and tensor mechanics · Lab

Linear regression: the first complete model

Linear regression learns a straight-line rule for predicting numbers.

PLAIN-LANGUAGE INTRODUCTION

What is this?

Linear regression learns a straight-line rule for predicting numbers.

One simple example

The hidden rule is y=3x−2. When x=4, the target is 10.

What goes in?

One number per example. Here, one input is x=4.

What comes out?

One predicted number. A trained model should return near 10.

Why does it matter?

This model shows every training step with simple arithmetic.

What is it not?

One straight line cannot represent every curved relationship.

WORK THROUGH THE IDEA

See the idea in more detail

  1. The model uses ŷ = wx+b. The symbol ŷ means predicted output.
  2. Start with w=1 and b=0. For x=4, the prediction is 4.
  3. The target is 10. The squared error is (4−10)² = 36.
  4. Training changes w and b. Good values approach 3 and −2 for this generated data.
  5. Common mistake: low training error alone does not prove good predictions on held-out inputs.
Open the detailed notes ↗