Bases: BaseModel
Container 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:
-
-
window: Union[Window, Literal['global']]
-
timestamp: datetime
-
metrics: dict[Union[Quantile, Literal['global']], dict[str, float]]
-
get_quantiles() → list[Quantile][source]
Return a list of quantiles present in the metrics.
- Return type:
list[Quantile]
- Returns:
Sorted list of quantile values (excluding ‘global’).
-
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: Union[Quantile, Literal['global']], metric_name: str) → Optional[float][source]
Retrieve a specific metric value for a given quantile.
- Parameters:
quantile (Union[Quantile, Literal['global']]) – The quantile level or ‘global’.
metric_name (str) – The name of the metric to retrieve.
- Return type:
Optional[float]
- Returns:
The metric value if it exists, otherwise None.
-
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}.
- Parameters:
prefix (str) – String prepended to every key.
- Return type:
dict[str, float]
- Returns:
Flat mapping of metric names to values.
-
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].