AIExplainer
Machine Learning Mathematics Intermediate 2 min read

What is L1 loss?

A measure of the difference between predicted and actual values

L1 loss, also known as mean absolute error, is a way to calculate the average difference between what a model predicts and what actually happens. It's used to train models to make better predictions.

Imagine you're trying to guess how many cookies are in a jar. L1 loss is like calculating the total difference between your guesses and the actual number of cookies. If you guess 10 cookies and there are actually 8, your L1 loss would be 2. If you guess 12 cookies, your L1 loss would be 4. The goal is to minimize this difference.

A company might use L1 loss to train a model that predicts energy consumption. The model would be trained on historical data, and the L1 loss would be calculated to measure the difference between the predicted and actual energy consumption.

L1 loss is used in machine learning to train models, especially in regression tasks where the goal is to predict a continuous value. It's often used in conjunction with other loss functions to improve model performance.

Some people think that L1 loss is the same as L2 loss, but they are different. L1 loss is more robust to outliers, while L2 loss is more sensitive to them.

L1 loss has been used in statistics and machine learning for decades, and is a fundamental concept in the field.

mean absolute error MAE L1 distance

Three products for different needs — explore what’s relevant to you.