SubsetMetric#
- class openstef_beam.evaluation.models.SubsetMetric(**data: Any) None[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:
data (
Any)
-
timestamp:
datetime
- to_dataframe() DataFrame[source]
Convert the metrics to a pandas DataFrame.
- Return type:
DataFrame- Returns:
DataFrame with quantiles as index and metric names as columns.
- get_metric(quantile: Quantile | Literal['global'], metric_name: str) Annotated[float, BeforeValidator(func=_convert_none_to_nan, json_schema_input_type=PydanticUndefined)] | None[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].