# Epoch (machine learning)

> Canonical: https://skillalmanac.com/glossary/epoch | Last verified: 2026-11-24 | Index status: index-eligible

In machine learning, an epoch is one full pass over the training set, so that each example has been processed once. Training usually takes many epochs, and the number of epochs is a hyperparameter set before training begins.

Also called: epoch in machine learning, epochs, epochs deep learning, what is an epoch, training epoch.

## In plain language

An epoch is one complete read-through of the study material. If a model trains on 1,000 examples, one epoch means every one of those 1,000 examples has been processed once. Google's course notes that training often takes many epochs, and that the number of epochs is a setting you choose before training starts. More epochs take more training time and do not guarantee better predictions on new data; validation performance and early stopping help detect overfitting.

## Technical definition

Google's Machine Learning Crash Course states that during training, an epoch means the model has processed every example in the training set once. With a training set of 1,000 examples and a mini-batch size of 100, it takes 10 iterations to complete one epoch. The course calls the number of epochs a hyperparameter you set before training begins. Keras Model.fit defines an epoch as an iteration over the entire x and y data provided, unless steps_per_epoch is set, and notes that with initial_epoch the epochs argument means the final epoch index.

## How it shows up when you use agents

If you ask a coding agent to train or fine-tune a model, the code it writes may include an `epochs` argument, as in Keras Model.fit, where `epochs` is the number of epochs to train the model. The number of epochs is a [hyperparameter](/glossary/hyperparameter).

Keras can evaluate validation data at the end of each epoch. Google's glossary describes [overfitting](/glossary/overfitting) as a model matching the training data so closely that it fails to predict well on new data, and [early stopping](/glossary/early-stopping) as ending training when the loss on a validation dataset starts to increase.

Google's glossary says one epoch represents N divided by the [batch size](/glossary/batch-size) training iterations, where N is the number of examples. With 1,000 examples, a batch size of 50 gives 20 iterations per epoch.

## Common confusions

- **Epoch versus batch.** Google's glossary says the batch size determines the number of examples in a batch, and relates a batch to an epoch through the iteration count.
- **Epoch versus iteration.** With 1,000 examples and a mini-batch size of 100, the Google course says it takes 10 iterations to complete one epoch.
- **Epoch versus steps per epoch.** In Keras, setting steps_per_epoch to something other than None changes what counts as an epoch, so it may not cover the entire data.

## Worked examples in this catalogue

### [split-leakage-check](https://skillalmanac.com/skills/skill-almanac/split-leakage-check)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: It checks train, validation and test files for duplicates, shared groups, time and label leakage; prints JSON.

Why it exercises the concept: An epoch is a pass over the training set, so the training files are read many times; this skill checks them for leakage.

## Related terms

- [Batch size](https://skillalmanac.com/glossary/batch-size.md)
- [Early stopping](https://skillalmanac.com/glossary/early-stopping.md)
- [Overfitting](https://skillalmanac.com/glossary/overfitting.md)
- [Gradient descent](https://skillalmanac.com/glossary/gradient-descent.md)
- [Hyperparameter](https://skillalmanac.com/glossary/hyperparameter.md)
- [Learning rate](https://skillalmanac.com/glossary/learning-rate.md)

## Sources

- [Linear regression: Hyperparameters](https://developers.google.com/machine-learning/crash-course/linear-regression/hyperparameters), Google for Developers (Machine Learning Crash Course) (accessed 2026-11-24)
- [Model training APIs (Model.fit)](https://keras.io/api/models/model_training_apis/), Keras (accessed 2026-11-24)
- [Machine Learning Glossary](https://developers.google.com/machine-learning/glossary), Google for Developers (accessed 2026-11-24)

Definitions are written by Skill Almanac from the sources above and checked against them on 2026-11-24. [Glossary index](https://skillalmanac.com/glossary.md).
