R2¶
- class R2(mode: str = MetricAggregationMode.per_segment, **kwargs)[source]¶
Bases:
etna.metrics.base.Metric
Coefficient of determination metric with multi-segment computation support.
\[R^2(y\_true, y\_pred) = 1 - \frac{\sum_{i=0}^{n-1}{(y\_true_i - y\_pred_i)^2}}{\sum_{i=0}^{n-1}{(y\_true_i - \overline{y\_true})^2}}\]Notes
You can read more about logic of multi-segment metrics in Metric docs.
Init metric.
- Parameters
mode ('macro' or 'per-segment') – metrics aggregation mode
kwargs – metric’s computation arguments
- Inherited-members
Attributes
name
Name of the metric for representation.