Loss Functions Flashcards
Loss functions
Loss functions are a crucial part of machine learning algorithms. They measure the inconsistency between predicted and actual outcomes and guide the learning process to adjust the model parameters.
- Mean Squared Error (MSE)
Used for regression tasks, MSE calculates the average squared difference between the actual and predicted values. This puts a high penalty on large errors. However, it’s sensitive to outliers since errors are squared before they’re averaged.
- Mean Absolute Error (MAE)
Also used for regression, MAE calculates the average absolute difference between actual and predicted values. It is less sensitive to outliers compared to MSE and provides a linear penalty to errors.
- Binary Cross-Entropy (Log Loss)
Used in binary classification problems, it calculates the log of the likelihood of the true label given the predicted probability. It has the benefit of punishing the model heavily when it is confident and wrong.
- Categorical Cross-Entropy
Used in multi-class classification problems, it is a generalization of Binary Cross-Entropy. It calculates the negative log likelihood of the true label given the predicted probability distribution over all classes.
- Hinge Loss
Used in Support Vector Machines and some neural network classifiers. It penalizes misclassified examples and disregards correctly classified ones, maximizing the margin of the decision boundary.
- Kullback-Leibler (KL) Divergence
It’s used when we want to compare two probability distributions. It is often used in unsupervised learning algorithms.
- Huber Loss
A combination of MSE and MAE. It behaves like MSE for small errors and MAE for large errors. It is less sensitive to outliers than MSE and is often used in robust regression.
- Quantile Loss
Used in quantile regression, for predicting an interval instead of a single point. It penalizes underestimates more heavily for higher quantiles and overestimates more heavily for lower quantiles.
- Focal Loss
An adaptation of the binary cross entropy loss, designed to address class imbalance by assigning more weights to hard-to-classify instances.