Spain Electricity Forecasting
Hourly forecasts for generation, demand, and prices using a stacking ensemble of XGBoost, LightGBM, Ridge, and Random Forest — trained on 3 years of Spanish electricity and weather data, tested across all of 2018.
Results
Feature Importance
Which weather measurements and cities influence demand, price, and generation the most?
Generation Forecasts
24-hour ahead predictions for solar and wind onshore generation.
Demand Forecasts
Total electricity load and residual load (backup gap) predictions.
Price Forecasts
Day-ahead electricity price predictions across 2018.
Model Selection
We evaluated multiple architectures — gradient boosting, DeepAR, TFT, PatchTST, and stacking ensembles. The Stacking Ensemble achieved the lowest MAE across all five targets (solar, wind, load, residual load, price) and is shown throughout this site. It combines out-of-fold predictions from four base learners with a Ridge meta-learner, trained per forecast horizon (24 models total per target).
| Target | MAE |
|---|---|
| Solar | 203.7 MW |
| Wind Onshore | 501.3 MW |
| Load | 649.0 MW |
| Residual Load | 651.0 MW |
| Price | 4.58 EUR/MWh |