RMAEPeakHoursProvider#
- class openstef_beam.evaluation.metric_providers.RMAEPeakHoursProvider(*, quantiles: list[Quantile] | None = None, lower_quantile: Quantile = 0.01, upper_quantile: Quantile = 0.99, start_peak_hours: int = 7, end_peak_hours: int = 20)[source]
Bases:
MetricProviderProvides Relative Mean Absolute Error metrics for peak hours only (8:00-20:00).
Normalizes MAE using specified quantile bounds but only considers data points between 8:00 and 20:00 hours.
- Parameters:
- property metric_names: frozenset[str]
Declared metric names that this provider produces.
Override in subclasses to enable eager metric-name validation (e.g. in the hyperparameter tuner).
- Overrides:
MetricProvider.metric_names
- lower_quantile: Quantile
- upper_quantile: Quantile
- start_peak_hours: int
- end_peak_hours: int
- __call__(subset: ForecastDataset, full_ground_truth: ForecastInputDataset | None = None) dict[Union[Quantile, Literal['global']], dict[str, float]][source]
Process an evaluation subset and return metrics.
Extracts predictions and ground truth from the subset, then computes metrics for all relevant quantiles.
- Parameters:
subset (
ForecastDataset) – Evaluation subset containing predictions and ground truth data.full_ground_truth (
ForecastInputDataset|None) – Unused by this provider.
- Return type:
- Returns:
QuantileMetricsDict mapping peak/off-peak periods to computed metric values.
- Overrides:
MetricProvider.__call__
- compute_deterministic(y_true: NDArray[floating], y_pred: NDArray[floating], quantile: Quantile) dict[str, float][source]
Compute metrics for a single quantile prediction.
Must be implemented by subclasses that provide deterministic metrics (per quantile).
- Parameters:
- Return type:
- Overrides:
MetricProvider.compute_deterministic
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': False, 'extra': 'ignore', 'protected_namespaces': ()}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].