Skip to content
BENIBIX Learn

Generalization

Also known as Generalisation, Generalization Error

How well a model does on new data. It is the whole point of training.

Think of it like

Think of it like riding one bike, and then you can ride any bike.

Example

Lucy's spam model scores 97 percent on its training mail and 96 percent on new mail. The small gap shows it generalizes well.

Why it matters

A model is only useful if it works on the data that comes next. This is how you know if it does.

Definition

Generalization is how well a model works on new data it never saw in training. It is the whole point of machine learning. You want the model to handle new cases, not just old ones. A model that generalizes well has learned the real pattern. You measure it with a test set kept apart from training. The gap between training and test scores shows how well it generalizes.
The middle panel generalizes. Its smooth curve will also fit new dots that land near the old ones.

Common mistake

Testing on data too much like the training data. If the test set comes from the same week, it may hide a model that fails next month.

Key takeaways

  1. 1
    New data. Never seen in training.
  2. 2
    The real goal. Not just old cases.
  3. 3
    Measured by the gap. Training score against test score.

Learn it properly