Tensor by Tensor

02.10 · UNIT 04 · Supervised learning and reliable experiments · Lab

Linear regression: the first complete model

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

PLAIN-LANGUAGE INTRODUCTION

The idea

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

A worked example

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

The input

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

The result

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

Why you use it

This model shows every training step with simple arithmetic.

A limit to remember

One straight line cannot represent every curved relationship.

Check your understanding

  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 ↗