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

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: bool

Whether higher metric value is better.