Data → Machine Learning & AI
Loss Function
A function that measures how wrong a model prediction is during training.
Motivation
A loss function solves the problem of turning model mistakes into a number that can be optimized.
Where it fits
It belongs to machine learning and optimization.
Mental model
The loss is the model’s scorecard. Training tries to make it smaller.
Important details
Different tasks need different losses, such as cross-entropy for classification or mean squared error for regression.
Common mistakes
- Choosing a loss that does not match the product goal.
- Optimizing the loss while ignoring real-world behavior.