netcal.metrics.regression.QuantileLoss

class netcal.metrics.regression.QuantileLoss

Pinball aka quantile loss within regression calibration to test for quantile calibration of a probabilistic regression model. The Pinball loss is an asymmetric loss that measures the quality of the predicted quantiles. Given a probabilistic regression model that outputs a probability density function (PDF) fY(y) targeting the ground-truth y, we further denote the cumulative as FY(y) and the (inverse) percent point function (PPF) as FY1(τ) for a certain quantile level τ[0,1].

The Pinball loss is given by

LPin(τ)={(yFY1(τ))τif yFY1(τ)(FY1(τ)y)(1τ)if y<FY1(τ).

Methods

__init__()

measure(X, y, q, *[, kind, reduction])

Measure quantile loss for given input data either as tuple consisting of mean and stddev estimates or as NumPy array consisting of a sample distribution.