Coverage

class Coverage(quantiles: Tuple[float, float] = (0.025, 0.975), mode: str = MetricAggregationMode.per_segment, **kwargs)[source]

Bases: etna.metrics.base.Metric, etna.metrics.intervals_metrics._QuantileMetricMixin

Coverage metric for prediction intervals - precenteage of samples in the interval [lower quantile, upper quantile].

\[Coverage(y\_true, y\_pred) = \frac{\sum_{i=0}^{n-1}{[ y\_true_i \ge y\_pred_i^{lower\_quantile}] * [y\_true_i \le y\_pred_i^{upper\_quantile}] }}{n}\]

Notes

Works just if quantiles presented in y_pred

Init metric.

Parameters
  • mode ('macro' or 'per-segment') – metrics aggregation mode

  • kwargs – metric’s computation arguments

  • quantiles (Tuple[float, float]) –

Inherited-members

Methods

set_params(**params)

Return new object instance with modified parameters.

to_dict()

Collect all information about etna object in dict.

Attributes

greater_is_better

Whether higher metric value is better.

name

Name of the metric for representation.

property greater_is_better: None

Whether higher metric value is better.