Regression, explained simply
Some models choose a label, like "berry" or "crystal". That is called classification. Other models predict a number, like a price, a temperature or a height. That is called regression.
A regression model looks at examples where both the clue and the answer are known, then finds a line or curve that fits them as closely as possible. For a new example, it reads the answer off that line.
Predictions work best inside the range of the training data. Ask about something far outside it, like a sunflower watered for a whole year when the data only covered a month, and the guess can be way off.
Example: Predicting sunflower height
- Sunny days → height: 10 days → 40 cm, 20 days → 80 cm, 30 days → 120 cm.
- The pattern: about 4 cm per sunny day.
- Prediction for 25 sunny days: about 100 cm.
Try this
- Measure a plant or your own height over several weeks and draw the points on graph paper. Can you draw a line through them?
- Guess the price of a bigger pizza from the prices of smaller ones.
- Think of a prediction that would be silly if you stretched the line too far.
