The **quantile loss** (often referred to as **pinball loss**) is an [[Error Metrics|error metric]] that is able to quantify the error of a [[Quantile Regression|quantile regression]] prediction.
Contrary to the rest of the metrics, this metric does not aim to get the predictions as close to the real values as possible. Instead, there is a **purposeful bias** to match the prediction to a given percentile of the predictions. The result of the pinball loss could be understood as the "*accuracy*" of the quantile model.
Being $q$ the target quantile, $y$ the real value and $\hat{y}$ our quantile prediction, the loss function can be expressed as:
$
L_{q}(y, \hat{y}) =
\left\{
\begin{array}{ll}
(y - \hat{y}) \cdot q & y \geq z \\
(y - \hat{y}) \cdot (q - 1) & y \lt z \\
\end{array}
\right.
$