Bases: BaseConformityScorer
Quantile residual scorer for interval forecasts.
Abstract base class for quantile-based conformity scoring.
Subclasses must implement the score method to compute
residuals between observed values and predicted interval bounds.
Notes
Unlike Residual and GammaResidual, this scorer operates on
interval predictions (lower/upper bounds) rather than point predictions.
The prediction_type tag is set to "interval".
See Also
Source Code
View on GitHub
Show/Hide source
| class QuantileResidual(BaseConformityScorer):
"""Quantile residual scorer for interval forecasts.
Abstract base class for quantile-based conformity scoring.
Subclasses must implement the ``score`` method to compute
residuals between observed values and predicted interval bounds.
Notes
-----
Unlike ``Residual`` and ``GammaResidual``, this scorer operates on
interval predictions (lower/upper bounds) rather than point predictions.
The ``prediction_type`` tag is set to ``"interval"``.
See Also
--------
- [`AbsoluteQuantileResidual`][yohou.metrics.conformity.AbsoluteQuantileResidual] : Absolute variant of quantile residuals.
- [`Residual`][yohou.metrics.conformity.Residual] : Point-prediction conformity scorer.
"""
def __sklearn_tags__(self):
"""Get the tags for this estimator."""
tags = super().__sklearn_tags__()
assert tags.scorer_tags is not None
tags.scorer_tags.prediction_type = "interval"
return tags
@abc.abstractmethod
def score(self, y_truth: pl.DataFrame, y_pred: pl.DataFrame, /, **score_params) -> pl.DataFrame:
"""Compute quantile residual scores."""
|
Methods
Get the tags for this estimator.
View on GitHub
Show/Hide source
| def __sklearn_tags__(self):
"""Get the tags for this estimator."""
tags = super().__sklearn_tags__()
assert tags.scorer_tags is not None
tags.scorer_tags.prediction_type = "interval"
return tags
|
Compute quantile residual scores.
Source Code
View on GitHub
Show/Hide source
| @abc.abstractmethod
def score(self, y_truth: pl.DataFrame, y_pred: pl.DataFrame, /, **score_params) -> pl.DataFrame:
"""Compute quantile residual scores."""
|