# Generalization

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

**Field:** Artificial Intelligence  
**Category:** Machine Learning  
**Also known as:** Generalisation, Generalization Error

## Think of it like

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

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

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

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

## Three principles

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

## Related terms

- [Overfitting](https://learn.benibix.com/term/ai/overfitting)
- [Underfitting](https://learn.benibix.com/term/ai/underfitting)
- [Test Set](https://learn.benibix.com/term/ai/test-set)
- [Bias-Variance Tradeoff](https://learn.benibix.com/term/ai/bias-variance-tradeoff)

## Taught in

- [Overfitting and Underfitting](https://learn.benibix.com/learn/ai-machine-learning/overfitting-and-underfitting): Machine Learning, 3/18

![Three panels of the same dots. Underfit: a straight line that misses the curve. Good fit: a smooth curve through the middle. Overfit: a wild line that touches every dot.](https://learn.benibix.com/diagrams/nn-model-fit.svg)

---

Source: https://learn.benibix.com/term/ai/generalization
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
