Skip to content
All tutors

Loss Functions and What They Reward

Choose a loss that matches what you actually care about, and know what each one optimises

By Skill Lab Intermediate Machine learning Math for AI New

Your first 3 replies from the tutor are free. Then you can continue the lesson for $7 from your credit.

A taste of a lesson

One question and the answer, as this tutor gives it.

Loss Functions and What They Reward AI tutor following Skill Lab's plan
Student:

We forecast stock levels. Running out costs us far more than overstock. Should I still train with squared error?

Tutor:

Squared error treats overshooting and undershooting equally and aims at the mean, which does not match your costs. Consider quantile loss: with tau = 0.9, the model learns a level that demand exceeds only about 10 percent of the time, so you run out less often at the price of extra stock. You can choose tau from the cost ratio: if a stockout costs 9 times an extra unit, tau = 9 / (9 + 1) = 0.9. What is your rough cost of a stockout compared with holding one extra unit?

Written with AI under Skill Lab's direction as an example. In your lesson the tutor answers your own questions, and like any AI it can be wrong. Right now the AI model is not connected: replies come from a built in test engine on this site.

What you will be able to do

  • Explain which statistic squared, absolute and quantile losses target
  • Choose robust losses such as Huber when outliers are present
  • Explain why log loss encourages calibrated probabilities
  • Encode unequal error costs with weighted or asymmetric losses
  • Check that the training loss aligns with the reported metric

Lesson plan

6 lessons. Pick one to start there.

  1. 1 A loss defines good See how different losses choose different best predictions. Start
  2. 2 Regression losses Compare squared, absolute and Huber losses. Start
  3. 3 Quantile loss Predict percentiles with the pinball loss. Start
  4. 4 Classification losses Understand log loss, hinge loss and the Brier score. Start
  5. 5 Unequal costs Encode real world costs into training. Start
  6. 6 Loss versus metric Align what you train on with what you report. Start

Try asking

Tap a question to start a lesson with it.

About this tutor

An intermediate tutor on the choice that quietly defines every model: the loss function. You will see that squared error targets the mean, absolute error the median and quantile loss any percentile you choose, and why log loss produces probabilities that can be trusted. Lessons cover Huber loss for outliers, hinge loss, class weighted and asymmetric losses for unequal costs, and the gap between the loss you train on and the metric you report. Exercises use small numeric examples so you can see each loss pull a prediction in a different direction.

Reviews

Students can review a tutor after a paid lesson. Nobody has yet.