Course contentsShow
← Machine Learning and Deep Learning
Lesson 476 of 3,53811. Model Evaluation MetricsFree lesson

Quantile Loss for Probabilistic Predictions

Understand quantile (pinball) loss for predicting specific percentiles and asymmetric penalty for under- vs over-prediction.

Quantile Loss for Probabilistic Predictions

What you'll learn: How to evaluate predictions that target specific percentiles (like the 10th or 90th) rather than just the mean, using a loss function that penalizes errors asymmetrically.

The Core Idea

Sometimes you don't just want to predict the average outcome—you want to predict specific percentiles. For example, a logistics company might want to predict the 90th percentile delivery time (a pessimistic estimate) to set customer expectations safely.

Quantile loss (also called pinball loss) is designed for this. It lets you predict any quantile (percentile) you choose, and it penalizes under-predictions and over-predictions differently depending on which quantile you're targeting.

How It Works

The quantile loss has an asymmetry parameter τ (tau), ranging from 0 to 1, representing the quantile:

  • τ = 0.5 → predicting the median (equal penalty for over/under)
  • τ = 0.9 → predicting the 90th percentile (heavier penalty for under-predicting)
  • τ = 0.1 → predicting the 10th percentile (heavier penalty for over-predicting)

For τ = 0.9, if your prediction is too low, you pay a penalty of 0.9 times the error. If it's too high, you only pay 0.1 times the error. This asymmetry pushes your model toward higher predictions.

When to Use It

Use quantile loss when:

  • You need probabilistic forecasts (prediction intervals)
  • Different error directions have different costs (e.g., understocking vs overstocking inventory)
  • You want multiple percentile predictions to understand uncertainty

Key Takeaway: Quantile loss enables predictions of specific percentiles by applying asymmetric penalties—heavier punishment for errors in the direction you care about more, making it ideal for risk-aware and probabilistic forecasting.