SubsetMetric#
- class openstef_beam.evaluation.models.SubsetMetric(*, window: Union[Window, Literal['global']], timestamp: datetime, metrics: dict[Union[Quantile, Literal['global']], dict[str, float]])[source]
Bases:
BaseModelContainer for evaluation metrics computed on a data subset.
Stores performance metrics organized by quantile and window, enabling detailed analysis of forecast quality across different probability levels and temporal periods.
- Parameters:
- timestamp: datetime
- to_dataframe() DataFrame[source]
Convert the metrics to a pandas DataFrame.
- Return type:
- Returns:
DataFrame with quantiles as index and metric names as columns.
- get_metric(quantile: Union[Quantile, Literal['global']], metric_name: str) Optional[float][source]
Retrieve a specific metric value for a given quantile.
- to_flat_dict(prefix: str = '') dict[str, float][source]
Flatten metrics into a single dict suitable for logging (e.g. MLflow).
Each key is
{prefix}{quantile}_{metric_name}.
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'protected_namespaces': (), 'ser_json_inf_nan': 'null'}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].