Machine Learning Foundations

Loss Function, explained

A loss function measures how wrong a model is on an example or batch so training can improve it.
Back to Glossary

Part of the Semantic Notion technical glossary.

Short Definition

A loss function measures how wrong a model is on an example or batch so training can improve it.

Intuition

The loss turns model mistakes into a number. Training tries to make that number smaller.

Technical Definition

A loss function maps predictions and targets to a scalar objective optimized by an algorithm such as gradient descent.

Example

Cross-entropy loss penalizes a classifier when it assigns low probability to the correct class.

Common Misunderstandings

Lower training loss does not always mean better real-world performance.
The loss function shapes what the model optimizes, not necessarily what users value.

Start here

Need the broader concept map?

Return to the glossary index to move from this definition into adjacent AI, ML, mathematics, and computer science terms.