Clear Sky Science · en
Machine learning long-term electricity demand forecasting system for strategic energy investments
Why tomorrow’s power needs matter today
Keeping the lights on in the decades ahead is far more complicated than simply building more power plants. Electricity demand is rising worldwide as populations grow, cities expand, and heatwaves become more frequent. If governments underestimate how much power people will need, they risk blackouts and wasted investments; if they overestimate, they can lock in expensive, underused infrastructure. This paper presents a new way to peer into that uncertain future using a blend of modern machine learning and carefully chosen national statistics, demonstrated with a detailed case study of Egypt.
Connecting everyday life to power demand
Behind every flip of a light switch lie many forces: how many people live in a country, how hot the summers are, how fast the economy grows, and how much generation capacity has already been built. Traditional forecasting tools often look mostly at past electricity use and, at best, a small handful of economic or weather indicators. That narrow view can miss important shifts, such as rapid urbanization or mounting national debt that affects fuel imports. The authors argue that national planners need a wider lens—one that simultaneously tracks electricity supply, climate, the economy, and population trends over many years.

Building a three-step forecasting engine
The study introduces a three-phase system designed for long-term, country-level forecasts. First comes data gathering and cleaning: the team assembles monthly and yearly records from 2000 to 2023 on electricity generation capacity, temperatures, rainfall, humidity, economic health, and population structure for Egypt. Because these sources come in different time intervals and occasionally contain gaps, the authors apply tailored interpolation methods to fill in missing values and convert everything to a common monthly timeline, while preserving important seasonal patterns such as hotter summers. They then examine how each variable behaves over time to determine whether specialized time-series models are appropriate.
Letting algorithms learn from the past
In the second phase, the researchers compare familiar statistical forecasting tools with more flexible machine learning models. Classical methods such as ARIMA and SARIMAX are used as benchmarks; these capture trends and some seasonal behavior but assume relatively simple relationships among variables. To handle the richer, multivariable data, the team turns to a deep learning approach called a Gated Recurrent Unit (GRU) network, which is well suited to learning patterns that unfold over months and years. They systematically tune the model’s internal settings with an optimization framework and test several network depths, ultimately finding that a single well-configured GRU layer strikes the best balance between accuracy and reliability for the available data.
Seeing which factors matter most
Raw accuracy is not enough if planners cannot understand what drives the model’s predictions. In the third phase, the authors use an interpretability technique known as SHAP to measure how much each input factor pushes forecasts up or down. This analysis reveals that population—both rural and urban—and income per person are the main engines of rising demand, with electricity generation capacity and external debt playing important supporting roles. Climate variables, especially extreme temperatures, still matter, but over the long term they contribute less than demographic and economic growth. By gradually removing less influential variables and re-evaluating performance, the authors identify a streamlined set of thirteen features that deliver strong and stable forecasts.

What the results mean for energy planning
Across many test runs, the refined GRU model explains more than four-fifths of the variation in Egypt’s electricity use and keeps average errors to just over 4 percent of typical monthly demand. This level of accuracy, combined with clear insight into which levers matter most, makes the system well suited for exploring “what-if” futures—such as faster urban growth, new power plants, or changing debt levels—and their impact on the grid. Although the case study focuses on Egypt, the framework relies on data that most countries already track and on transparent processing steps, making it transferable worldwide. In essence, the work offers decision-makers a practical, interpretable forecasting engine that links everyday social and economic change to the power systems that must keep pace.
Citation: Haggag, M., Abdelhady, K., Guirguis, M. et al. Machine learning long-term electricity demand forecasting system for strategic energy investments. Sci Rep 16, 12471 (2026). https://doi.org/10.1038/s41598-026-45123-x
Keywords: electricity demand forecasting, energy planning, machine learning, climate and energy, urbanization