intervals_metrics¶
Functions
|
Classes
|
Coverage metric for prediction intervals - precenteage of samples in the interval |
|
Mean width of prediction intervals. |
- class Coverage(quantiles: Tuple[float, float] = (0.025, 0.975), mode: str = MetricAggregationMode.per_segment, **kwargs)[source]¶
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]) –
- set_params(**params: dict) etna.core.mixins.TMixin ¶
Return new object instance with modified parameters.
Method also allows to change parameters of nested objects within the current object. For example, it is possible to change parameters of a
model
in aPipeline
.Nested parameters are expected to be in a
<component_1>.<...>.<parameter>
form, where components are separated by a dot.- Parameters
**params – Estimator parameters
self (etna.core.mixins.TMixin) –
params (dict) –
- Returns
New instance with changed parameters
- Return type
etna.core.mixins.TMixin
Examples
>>> from etna.pipeline import Pipeline >>> from etna.models import NaiveModel >>> from etna.transforms import AddConstTransform >>> model = model=NaiveModel(lag=1) >>> transforms = [AddConstTransform(in_column="target", value=1)] >>> pipeline = Pipeline(model, transforms=transforms, horizon=3) >>> pipeline.set_params(**{"model.lag": 3, "transforms.0.value": 2}) Pipeline(model = NaiveModel(lag = 3, ), transforms = [AddConstTransform(in_column = 'target', value = 2, inplace = True, out_column = None, )], horizon = 3, )
- to_dict()¶
Collect all information about etna object in dict.
- property greater_is_better: None¶
Whether higher metric value is better.
- property name: str¶
Name of the metric for representation.
- class Width(quantiles: Tuple[float, float] = (0.025, 0.975), mode: str = MetricAggregationMode.per_segment, **kwargs)[source]¶
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]) –
- set_params(**params: dict) etna.core.mixins.TMixin ¶
Return new object instance with modified parameters.
Method also allows to change parameters of nested objects within the current object. For example, it is possible to change parameters of a
model
in aPipeline
.Nested parameters are expected to be in a
<component_1>.<...>.<parameter>
form, where components are separated by a dot.- Parameters
**params – Estimator parameters
self (etna.core.mixins.TMixin) –
params (dict) –
- Returns
New instance with changed parameters
- Return type
etna.core.mixins.TMixin
Examples
>>> from etna.pipeline import Pipeline >>> from etna.models import NaiveModel >>> from etna.transforms import AddConstTransform >>> model = model=NaiveModel(lag=1) >>> transforms = [AddConstTransform(in_column="target", value=1)] >>> pipeline = Pipeline(model, transforms=transforms, horizon=3) >>> pipeline.set_params(**{"model.lag": 3, "transforms.0.value": 2}) Pipeline(model = NaiveModel(lag = 3, ), transforms = [AddConstTransform(in_column = 'target', value = 2, inplace = True, out_column = None, )], horizon = 3, )
- to_dict()¶
Collect all information about etna object in dict.
- property greater_is_better: bool¶
Whether higher metric value is better.
- property name: str¶
Name of the metric for representation.