Width¶
- class Width(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
Mean width of prediction intervals.
\[Width(y\_true, y\_pred) = \frac{\sum_{i=0}^{n-1}\mid y\_pred_i^{upper\_quantile} - y\_pred_i^{lower\_quantile} \mid}{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
Attributes
name
Name of the metric for representation.