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
- The model uses
ŷ = wx+b. The symbolŷmeans predicted output. - Start with
w=1andb=0. Forx=4, the prediction is4. - The target is
10. The squared error is(4−10)² = 36. - Training changes
wandb. Good values approach3and−2for this generated data. - Common mistake: low training error alone does not prove good predictions on held-out inputs.