Skip to content
Senghak Rou
All projects

Machine Learning & Forecasting · Aug – Sep 2026

Forecasting French regional electricity demand

Hourly demand forecasts for 12 French regions, 1 to 24 hours ahead, evaluated under a strict information rule and a test year opened only once.

Status
CompletedResearch complete on retrospective evaluation; the prospective seven-day pilot remains unfinished.
Setting
Individual projectPersonal project
My role
Sole author: data pipeline, information rule, models, evaluation protocol, API and dashboard.
Methods and tools
Python · pandas · statsmodels · scikit-learn · LightGBM · Optuna · FastAPI · Streamlit · SQLite

3.66 %

WAPE of the selected LightGBM model, protected 2024 test

Mean over 12 regions, horizons 1–24

4.87 %

WAPE of the regional Ridge reference, same test

12 × 24

Regions × hourly horizons from every forecast origin

Overview

Grid operators balance supply and demand hour by hour. This project forecasts mean hourly electricity demand for each of the 12 mainland French regions, 1 to 24 hours ahead, from public RTE data. The focus is an evaluation that can be trusted: features use only what would be published at forecast time, the model is chosen by a rule fixed in advance, and the 2024 test year was opened once. On that test, LightGBM reached a mean regional WAPE of 3.66 %, against 4.87 % for a regional Ridge reference.

What a forecast may know

Regional demand is assumed to be published two hours late. A forecast issued at hour tt may therefore use observations up to t−2t-2 only, in development, in testing and in operation alike.

Information available at a forecast origin Hourly demand cells for one region. Cells up to t minus 2 are observed and usable as features. The hours t minus 1 and t exist but are not yet published because of the two-hour delay. From origin t the system forecasts the next 24 hours, one model per horizon. known at the origin 24 targets: horizons h = 1, …, 24 origin t: forecast issued … latest usable value yr,t−2 exists, not yet published (2-hour delay) features read only grey cells: lags at t−24 and t−168, 24 h and 168 h rolling means, and the target hour's calendar
Figure 1 · SchematicOne forecast origin. Grey cells are usable; the hatched hours exist but are not yet published. Each of the 24 horizons has its own model.

Accuracy is the weighted absolute percentage error per region rr and calendar year PP, averaged with equal weight over region–years so that small regions count as much as Île-de-France:

WAPEr,P=100×∑t+h∈P∣yr,t+h−y^r,t+h∣t∣∑t+h∈P∣yr,t+h∣.\mathrm{WAPE}_{r,P} = 100 \times \frac{\sum_{t+h \in P} \lvert y_{r,t+h} - \hat y_{r,t+h \mid t} \rvert}{\sum_{t+h \in P} \lvert y_{r,t+h} \rvert}.

Models and evaluation

Four model families produce the same 24 forecasts per region and origin: a weekly naive benchmark that repeats the value one week earlier, ARIMA and seasonal ARIMA with five fixed orders, Ridge regression (one model per horizon, pooled or per region), and LightGBM (24 horizon models trained on absolute error, 40 Optuna trials).

Evaluation protocol: expanding-window folds, one protected test year, then a shadow pilot Three development folds train on all data from 2017 up to the validation year and score that year: 2021, 2022 and 2023. After the specification is frozen, the selected model is refitted on 2017 to 2023 and scored once on 2024 against four predeclared gates, which all passed. The unfinished pilot protocol requires seven days of prospective records. ’17 ’18 ’19 ’20 ’21 ’22 ’23 ’24 // 2026 fold 2021 fold 2022 fold 2023 protected test 2024 never read during development pilot one model selected by a rule fixed in advance rule: lowest mean regional WAPE; within 0.01 pp, the simpler model refit on 2017–2023, scored once on 2024: 4 gates, all passed seven-day record required for live scoring fit (expanding window, 24 h purged) scored unfinished pilot
Figure 2 · SchematicExpanding-window folds select the model; the frozen specification is then refitted on 2017–2023 and scored once on 2024.

The 2024 release had to pass four predeclared gates: complete predictions; a 95 % paired block-bootstrap interval for the WAPE difference against Ridge lying below zero; no region more than 5 % worse than Ridge; and empirical coverage of the 90 % prediction intervals between 85 % and 95 %.

Results

Development error of the non-LightGBM candidates

Primary WAPE (%) — mean of region–year WAPEs, validation 2021–2023. Lower is better.

02468101214Primary WAPE (%)Regional RidgeRegional Ridge: WAPE 5.11%, MAE 212 MW5.11%Pooled RidgePooled Ridge: WAPE 5.35%, MAE 221 MW5.35%SARIMA(2,0,0)(1,0,0)₂₄SARIMA(2,0,0)(1,0,0)₂₄: WAPE 5.6%, MAE 233 MW5.60%SARIMA(1,0,0)(1,0,0)₂₄SARIMA(1,0,0)(1,0,0)₂₄: WAPE 5.91%, MAE 245 MW5.91%Weekly naiveWeekly naive: WAPE 8.34%, MAE 349 MW8.34%ARIMA(2,1,0)ARIMA(2,1,0): WAPE 11.43%, MAE 491 MW11.43%ARIMA(1,1,1)ARIMA(1,1,1): WAPE 11.86%, MAE 510 MW11.86%ARIMA(1,1,0)ARIMA(1,1,0): WAPE 12.41%, MAE 537 MW12.41%
Data table
ModelPrimary WAPE (%)MAE (MW)RMSE (MW)Bias (MW)
Regional Ridge5.1121230016.9
Pooled Ridge5.352213118.8
SARIMA(2,0,0)(1,0,0)₂₄5.623335112.5
SARIMA(1,0,0)(1,0,0)₂₄5.912453707.1
Weekly naive8.343495459.9
ARIMA(2,1,0)11.434916831.5
ARIMA(1,1,1)11.865107081.5
ARIMA(1,1,0)12.415377501.4
Figure 3 · Experimental resultRegional Ridge was the strongest classical model and the reference LightGBM had to beat. LightGBM's search was still running when this snapshot was taken; its 2024 score is below.Source: model_comparison.csv (repository commit 5fe66b7); 2021–2023, all regions and horizons, same eligible rows for every model.

Among the classical models, regional Ridge was the strongest in development (5.11 %). ARIMA without a daily seasonal term cannot reproduce the intraday profile and stays above 11 %.

Error by forecast horizon

Primary WAPE (%) at each horizon h = 1, …, 24 hours, validation 2021–2023.

  • Weekly naive
  • SARIMA(2,0,0)(1,0,0)₂₄
  • Regional Ridge
036914812162024Forecast horizon h (hours after the origin)WAPE (%)Weekly naive, h = 1: WAPE 8.34%Weekly naive, h = 2: WAPE 8.34%Weekly naive, h = 3: WAPE 8.34%Weekly naive, h = 4: WAPE 8.34%Weekly naive, h = 5: WAPE 8.34%Weekly naive, h = 6: WAPE 8.34%Weekly naive, h = 7: WAPE 8.34%Weekly naive, h = 8: WAPE 8.34%Weekly naive, h = 9: WAPE 8.34%Weekly naive, h = 10: WAPE 8.34%Weekly naive, h = 11: WAPE 8.34%Weekly naive, h = 12: WAPE 8.34%Weekly naive, h = 13: WAPE 8.34%Weekly naive, h = 14: WAPE 8.33%Weekly naive, h = 15: WAPE 8.33%Weekly naive, h = 16: WAPE 8.33%Weekly naive, h = 17: WAPE 8.33%Weekly naive, h = 18: WAPE 8.33%Weekly naive, h = 19: WAPE 8.33%Weekly naive, h = 20: WAPE 8.33%Weekly naive, h = 21: WAPE 8.33%Weekly naive, h = 22: WAPE 8.33%Weekly naive, h = 23: WAPE 8.33%Weekly naive, h = 24: WAPE 8.33%SARIMA(2,0,0)(1,0,0)₂₄, h = 1: WAPE 3.47%SARIMA(2,0,0)(1,0,0)₂₄, h = 2: WAPE 3.98%SARIMA(2,0,0)(1,0,0)₂₄, h = 3: WAPE 4.35%SARIMA(2,0,0)(1,0,0)₂₄, h = 4: WAPE 4.63%SARIMA(2,0,0)(1,0,0)₂₄, h = 5: WAPE 4.81%SARIMA(2,0,0)(1,0,0)₂₄, h = 6: WAPE 4.97%SARIMA(2,0,0)(1,0,0)₂₄, h = 7: WAPE 5.12%SARIMA(2,0,0)(1,0,0)₂₄, h = 8: WAPE 5.26%SARIMA(2,0,0)(1,0,0)₂₄, h = 9: WAPE 5.4%SARIMA(2,0,0)(1,0,0)₂₄, h = 10: WAPE 5.54%SARIMA(2,0,0)(1,0,0)₂₄, h = 11: WAPE 5.68%SARIMA(2,0,0)(1,0,0)₂₄, h = 12: WAPE 5.8%SARIMA(2,0,0)(1,0,0)₂₄, h = 13: WAPE 5.9%SARIMA(2,0,0)(1,0,0)₂₄, h = 14: WAPE 5.97%SARIMA(2,0,0)(1,0,0)₂₄, h = 15: WAPE 6.03%SARIMA(2,0,0)(1,0,0)₂₄, h = 16: WAPE 6.09%SARIMA(2,0,0)(1,0,0)₂₄, h = 17: WAPE 6.14%SARIMA(2,0,0)(1,0,0)₂₄, h = 18: WAPE 6.18%SARIMA(2,0,0)(1,0,0)₂₄, h = 19: WAPE 6.22%SARIMA(2,0,0)(1,0,0)₂₄, h = 20: WAPE 6.26%SARIMA(2,0,0)(1,0,0)₂₄, h = 21: WAPE 6.27%SARIMA(2,0,0)(1,0,0)₂₄, h = 22: WAPE 6.36%SARIMA(2,0,0)(1,0,0)₂₄, h = 23: WAPE 6.82%SARIMA(2,0,0)(1,0,0)₂₄, h = 24: WAPE 7.23%Regional Ridge, h = 1: WAPE 4.46%Regional Ridge, h = 2: WAPE 4.65%Regional Ridge, h = 3: WAPE 4.78%Regional Ridge, h = 4: WAPE 4.82%Regional Ridge, h = 5: WAPE 4.8%Regional Ridge, h = 6: WAPE 4.77%Regional Ridge, h = 7: WAPE 4.76%Regional Ridge, h = 8: WAPE 4.77%Regional Ridge, h = 9: WAPE 4.84%Regional Ridge, h = 10: WAPE 5.03%Regional Ridge, h = 11: WAPE 5.25%Regional Ridge, h = 12: WAPE 5.44%Regional Ridge, h = 13: WAPE 5.54%Regional Ridge, h = 14: WAPE 5.55%Regional Ridge, h = 15: WAPE 5.51%Regional Ridge, h = 16: WAPE 5.47%Regional Ridge, h = 17: WAPE 5.41%Regional Ridge, h = 18: WAPE 5.33%Regional Ridge, h = 19: WAPE 5.26%Regional Ridge, h = 20: WAPE 5.16%Regional Ridge, h = 21: WAPE 4.97%Regional Ridge, h = 22: WAPE 4.85%Regional Ridge, h = 23: WAPE 5.39%Regional Ridge, h = 24: WAPE 5.75%
Data table
Horizon (h)Weekly naiveSARIMA(2,0,0)(1,0,0)₂₄Regional Ridge
18.343.474.46
28.343.984.65
38.344.354.78
48.344.634.82
58.344.814.8
68.344.974.77
78.345.124.76
88.345.264.77
98.345.44.84
108.345.545.03
118.345.685.25
128.345.85.44
138.345.95.54
148.335.975.55
158.336.035.51
168.336.095.47
178.336.145.41
188.336.185.33
198.336.225.26
208.336.265.16
218.336.274.97
228.336.364.85
238.336.825.39
248.337.235.75
Figure 4 · Experimental resultSARIMA is better for the first four hours, when recent demand dominates; Ridge, driven by the calendar and weekly lags, is better from horizon 5.Source: horizon_wape_equal_region_year.csv, same snapshot as the development comparison.
Protected test, 2024 (run once)Mean regional WAPE
LightGBM, selected configuration3.66 %
Regional Ridge (reference)4.87 %

LightGBM cut the error by about a quarter and passed all four gates. Trees capture interactions, such as the same hour on a winter weekday or a school holiday, that a linear model only sees through hand-built terms. Adding temperature under a safe 48-hour delay lowered Ridge's development WAPE by only 0.02 pp, so weather stayed a challenger.

System

System overview of the forecasting project RTE regional demand and the French calendar pass quality checks onto an hourly UTC grid; Météo-France weather is ingested for challenger models only. A feature builder applies the two-hour availability rule and feeds four candidate model families: weekly naive, SARIMA, Ridge and LightGBM. The pilot implementation connects the frozen LightGBM model, an hourly worker, SQLite, FastAPI and Streamlit. Prospective evaluation remains unfinished. RTE demand calendar weather (challengers only) checks hourly UTC grid, no imputation features 2-hour rule, 15 inputs + region weekly naive SARIMA Ridge LightGBM local pilot implementation · prospective evaluation unfinished frozen model hourly worker SQLite FastAPI Streamlit dashboard
Figure 5 · SchematicThe installable Python package, from public data to an unfinished shadow pilot. Dashed: weather feeds challenger models only.

Raw downloads carry checksums, and the release pipeline refuses to run the protected evaluation if code, data or dependencies changed after the freeze.

Limitations and status

  • One test year. 2024 is a single realisation; year-to-year reliability is not established.
  • Availability is simulated. The test replays revised data with a two-hour delay; it is not a record of historical live retrievals.
  • Pilot unfinished. The protocol requires seven consecutive days of complete records. The repository has tooling for a local pilot and no completed pilot record.

Individual contribution

References

  1. RTE, éCO2mix regional consumption data. rte-france.com
  2. Ke, G. et al. (2017). LightGBM: a highly efficient gradient boosting decision tree. NeurIPS.
  3. Hyndman, R. J. and Athanasopoulos, G. (2021). Forecasting: Principles and Practice, 3rd ed. OTexts.
Oct – Dec 2025Completed

Temperature and regional electricity use

A team data-science project linking daily temperature to regional electricity consumption (2020–2024): data assembly from RTE and NASA POWER, regional fixed-effects regressions, and predictive models evaluated on a held-out year.

Machine Learning & Forecasting · Team of 3 · Python, pandas, statsmodels

Apr – May 2026Completed

Forecasting French oil production with ARIMA

Box–Jenkins analysis of a monthly French industrial production index (1990–2026): stationarity testing, ARMA order selection, residual diagnostics and a joint 95 % prediction region for the next two observations.

Statistics & Econometrics · Team of 2 · R, tseries, stats::arima