backtesting#

Tests forecasting models by simulating how they would perform in real operations.

In real-world energy forecasting, you can’t use future data to make predictions about the past. This module creates realistic test scenarios by “replaying” historical data as if it were happening in real-time. Models are retrained periodically, just like in actual deployment, and predictions are made with only past data available.

Why this matters:

  • Prevents data leakage: No cheating with future information

  • Realistic performance: Results match what you’d see in production

  • Operational constraints: Simulates real training schedules and data availability

  • Fair comparison: All models tested under identical conditions

Submodules#

openstef_beam.backtesting.backtest_callback

Extension points for backtesting pipeline customization.

openstef_beam.backtesting.backtest_event

Core event types that drive backtesting simulations.

openstef_beam.backtesting.backtest_event_generator

Event scheduling engine for realistic backtesting simulations.

openstef_beam.backtesting.backtest_pipeline

Backtesting pipeline for evaluating energy forecasting models.

openstef_beam.backtesting.restricted_horizon_timeseries

Compatibility layer for versioned time series accessors.

backtest_forecaster

Forecasting model adapter layer for backtesting integration.

Classes#

BacktestConfig(**data)

Configuration for backtesting energy forecasting models.

BacktestPipeline(config, forecaster)

Pipeline for conducting realistic backtesting of energy forecasting models.