Machine Learning

Loss Function

A mathematical function that measures how far a model's predictions are from the actual correct values. The goal of training is to minimize this loss function, making predictions as accurate as possible.

Why It Matters

Choosing the right loss function is critical — it defines what 'good' means for your model. The wrong loss function leads to a model optimizing for the wrong thing.

Example

Mean Squared Error for predicting house prices (penalizes large errors heavily), or Cross-Entropy Loss for classification tasks like spam detection.

Think of it like...

Like a scorekeeper in a game who measures how far off each player's guess is from the correct answer — the training process tries to minimize that score.

Related Terms