Skip to contents

Also referred to as:

  • \(\pi-risk\) (2)

  • \(p*-loss\) (3)

  • \(ρ-quantile loss R_{ρ}\) (4). It's a metric based on the quantile loss. Loss value for a single sample-timestep-quantile is computed as: $$QL(y_t, \hat{y}_t, q) = max(q(y_t - \hat{y}_t), (q - 1)(y_t - \hat{y}_t))$$ or equivalently as : $$QL(y_t, \hat{y}_t, q) = max(q(y_t - \hat{y}_t), 0) + max((1 - q)(\hat{y}_t - y_t), 0)$$ The final form of the metric looks as follows: $$q-Risk = \frac{2\Sigma_{y_t \in \Omega}\Sigma^{\tau_{max}}_{\tau=1}QL(y_t, \hat{y}(q, t - \tau, \tau), q)}{\Sigma_{y_t \in \Omega}\Sigma^{\tau_{max}}_{\tau=1}{|y_t|}}$$

Usage

metric_q_risk(...)

Arguments

quantile

A desired quantile expressed as a numeric in range 0, 1.

See also

Examples

y_pred <- array(runif(60), c(2, 10, 1))
y_true <- array(runif(20), c(2, 10, 1))

metric_q_risk(quantile=0.5)(y_pred, y_true)
#> tf.Tensor(0.8072141, shape=(), dtype=float32)
metric_q_risk(quantile=0.9)(y_pred, y_true)
#> tf.Tensor(0.8557829, shape=(), dtype=float32)