RelativePinballLossProvider#

class openstef_beam.evaluation.metric_providers.RelativePinballLossProvider(**data: Any) None[source]

Bases: MetricProvider

Provides Relative Pinball Loss metrics for quantile predictions.

Computes the relative pinball loss (also known as relative quantile loss) for each quantile, normalized by the measurement range to make it scale-invariant and suitable for comparing quantile prediction errors across different datasets.

Parameters:

data (Any)

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).

measurement_range_lower_q: float
measurement_range_upper_q: float
compute_deterministic(y_true: ndarray[tuple[Any, ...], dtype[floating]], y_pred: ndarray[tuple[Any, ...], dtype[floating]], quantile: float) dict[str, Annotated[float, BeforeValidator(func=_convert_none_to_nan, json_schema_input_type=PydanticUndefined)]][source]

Compute metrics for a single quantile prediction.

Must be implemented by subclasses that provide deterministic metrics (per quantile).

Parameters:
Return type:

dict[str, float]

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].