Chapter 2 · Machine learning basics
Normalisation and feature scaling
Put features on similar scales so no single big number dominates learning.
Chapter 2 · Machine learning basics
Put features on similar scales so no single big number dominates learning.
Before: size shouts, rooms whisper
A model sees only numbers. A feature measured in thousands drowns out one measured in single digits. Scaling lets both be heard.
A house has a size like 1800 and a room count like 3. Neither is wrong, but their sizes are very different.
A tiny model predicts house price from size and rooms. The left run uses raw numbers, the right one uses scaled numbers, both at the learning rate you set. Try a big rate, then crawl down to a tiny one.
Exploded: steps too big for these numbers
Final loss < 0.001
First three sizes: raw 450.00, 700.00, 900.00 → scaled -1.43, -1.01, -0.66
The charts show loss (error) on a log scale, lower is better. A teaching version: eight made-up houses and plain gradient descent.
Why do large-valued features cause trouble?
Min-max scaling puts values in…
How should new data be scaled after training?