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
- 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.