OpenSTEF4BacktestForecaster#

class openstef_beam.benchmarking.baselines.openstef4.OpenSTEF4BacktestForecaster(**data: Any) None[source]

Bases: BaseModel, BacktestForecasterMixin

Forecaster that allows using a ForecastingWorkflow to be used in backtesting, specifically for OpenSTEF4 models.

A new workflow is created each time fit() is called using the provided workflow_factory, ensuring fresh model instances for each training cycle during benchmarking.

Parameters:

data (Any)

config: BacktestForecasterConfig
workflow_template: CustomForecastingWorkflow
cache_dir: Path
debug: bool
contributions: bool
extra_callbacks: list[ForecastingCallback]
model_post_init(context: Any) None[source]

Override this method to perform additional initialization after __init__ and model_construct. This is useful if you want to do some validation that requires the entire model to be initialized.

Parameters:

context (Any)

Return type:

None

property quantiles: list[Quantile]

Return the list of quantiles that this forecaster predicts.

fit(data: RestrictedHorizonVersionedTimeSeries) None[source]

Handles the training of the model.

Parameters:
  • data (RestrictedHorizonVersionedTimeSeries) – Time series data with context for training.

  • data

Return type:

None

predict(data: RestrictedHorizonVersionedTimeSeries) TimeSeriesDataset | None[source]

Core prediction logic to be implemented by subclasses.

Parameters:
  • data (RestrictedHorizonVersionedTimeSeries) – Time series data with context for prediction.

  • data

Returns:

DataFrame with predictions or None if prediction cannot be performed.
  • The predictions should be formatted in quantile columns [quantile_PXX]

  • The index should be the timestamp of the prediction

Return type:

TimeSeriesDataset | None

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