Machine Learning Systems Tuned by Bayesian Optimization to Forecast Electricity Demand and Production

Zhen Wang, Salim Lahmiri, Stelios D. BekirosAlgorithms 2025 · DOI

TL;DR

This paper explores the effectiveness of various machine learning and deep learning models for forecasting electricity demand and wind generation across different time granularities (15-min and 60-min) in Europe. By employing Bayesian optimization for hyperparameter tuning, the study reveals that while Decision Trees (DTs) often excel in accuracy, especially for shorter intervals, Deep Neural Networks (DNNs) show strong performance for longer intervals, highlighting the nuanced trade-offs in model selection for energy forecasting.

What Problem Does This Paper Address?

Accurate forecasting of electricity demand and renewable energy production (like wind power) is crucial for managing power grids, ensuring stability, and integrating intermittent sources. The increasing reliance on renewables introduces significant variability and unpredictability, making traditional forecasting methods insufficient. This paper addresses the challenge of finding the most effective machine learning and deep learning models for these tasks, considering different data granularities and geographical regions, and investigating how hyperparameter optimization impacts their performance.

Methods

The study compares several machine learning and deep learning models:

  • Deep Learning Models: Convolutional Neural Networks (CNNs), Temporal CNN (TCNN), Long Short-Term Memory (LSTM), Bidirectional LSTM (BiLSTM), Gated Recurrent Unit (GRU), Bidirectional GRU (BiGRU), and Deep Neural Network (DNN).
  • Standard Machine Learning Models: K-Nearest Neighbors (KNN) and Decision Trees (DTs) were used as baselines.

A key methodological contribution is the use of Bayesian optimization to tune the hyperparameters of all models. This approach is more efficient than grid or random search, especially for computationally intensive models, and aims to find optimal configurations for each model and dataset. The models were evaluated using standard metrics: Root Mean Squared Error (RMSE), Mean Absolute Error (MAE), Mean Absolute Deviation (MAD), and Mean Absolute Scaled Error (MASE).

Datasets

The study utilizes data from the Open Power System Data platform, specifically preprocessed time series data for electricity loads and wind power generation in megawatts. The data covers Austria (AT), Germany (DE), and the Netherlands (NL). For computational efficiency, the researchers selected the most recent 10,000 observations from each dataset, differentiating between 15-minute and 60-minute intervals.

Key Insights and Ideas

  • DT Dominance for Short Intervals: Decision Trees (DTs) consistently emerged as the top-performing model for 15-minute interval forecasts across most electricity load and wind generation datasets, often achieving the lowest RMSE, MAE, and MASE.
  • DNN Strength for Longer Intervals: For 60-minute electricity load forecasts, Deep Neural Networks (DNNs) often outperformed other models, indicating their capability to capture longer-term dependencies.
  • Hyperparameter Tuning is Crucial: The use of Bayesian optimization was essential for achieving optimal performance from the various models, suggesting that well-tuned models can significantly improve forecasting accuracy.
  • Wind Forecasting Challenges: Wind generation forecasting proved more difficult than electricity load forecasting, with most models showing moderate performance and MASE values often exceeding 1, indicating they performed worse than a simple naïve benchmark. This highlights the inherent unpredictability of wind patterns.
  • Optimization Time Trade-offs: While DTs were often the most accurate for short intervals, their optimization time was generally higher than KNN. Conversely, deep learning models, while potentially more accurate for longer intervals, required significantly more computational time for optimization.

Key Results

  • Electricity Load (15-min): DT achieved the lowest RMSE and MAE in Austria (RMSE: 63.07, MAE: 46.77) and Germany (RMSE: 476.06, MAE: 351.20).
  • Electricity Load (60-min): DNN showed superior performance in Germany (RMSE: 809.76, MAE: 609.66) and Austria (RMSE: 119.98, MAE: 90.09).
  • Wind Generation (15-min): DT was the best performer in Austria (RMSE: 47.61, MAE: 30.28). For Germany, DNN was the most proficient (RMSE: 450.76, MAE: 321.39).
  • Wind Generation (60-min): DT performed best in the Netherlands (RMSE: 78.82, MAE: 55.65), while in Germany, DT also led (RMSE: 765.73, MAE: 554.87).
  • Optimization Time: DT and KNN generally had the lowest optimization times, often in fractions of a minute, whereas deep learning models like TCNN could take hundreds of minutes.

Limitations and Future Work

The authors acknowledge that the optimization process was limited to thirty iterations, which might not be sufficient for all neural network models to find their absolute best parameter combinations. They also point out that external factors, such as the unpredictable peaks in electricity loads and the volatile nature of wind, pose significant challenges to achieving high model accuracy. Future work could explore longer optimization periods, investigate the impact of additional external factors, and potentially develop hybrid models that combine the strengths of different approaches to better handle the inherent complexities and volatilities of energy markets.

Summary updated

BibTeX
@article{wang2025machine,
  author = {Zhen Wang and Salim Lahmiri and Stelios D. Bekiros},
  title = {{Machine Learning Systems Tuned by Bayesian Optimization to Forecast Electricity Demand and Production}},
  journal = {Algorithms},
  year = {2025},
  doi = {10.3390/a18110695},
}
Figure