Machine Learning Forecasting for Electricity Demand Using Climate and Socioeconomic Data in Sub-Saharan Africa

dc.contributor.authorLutalo, Lordin
dc.date.accessioned2026-10-08T19:50:52Z
dc.date.available2026-10-08T19:50:52Z
dc.date.issued2026-09-30
dc.description.abstractElectricity demand forecasting is important for energy planning, resource allocation, and infrastructure development. In Sub-Saharan Africa, forecasting electricity demand is particularly difficult because electricity usage is driven by rapid population growth, economic changes, urbanisation, and climate variability, while data quality and availability remain inconsistent across countries. Although previous studies showed that climate and socioeconomic variables are associated with electricity demand, many focused on short-term forecasting, single-country analysis, or datasets from developed regions. This study examined how far integrated climate and socioeconomic data improves annual electricity demand forecasting across 47 Sub-Saharan African countries. Country-level panel time-series data was collected from publicly available sources including the World Bank, Our World in Data, and the ERA5 climate reanalysis dataset, covering the period from 2000 to 2021. The methodology included data integration and preprocessing, normality testing, temporal feature engineering, a two-stage feature selection process, and the training and comparison of six forecasting models: Linear Regression, Fixed Effects Panel Regression, Dynamic Fixed Effects Panel Regression, Random Forest, XGBoost, and LightGBM. Model performance was evaluated using Mean Absolute Error (MAE), Root Mean Squared Error (RMSE), Mean Absolute Percentage Error (MAPE), and the coefficient of determination (R^2). A decision-support dashboard was also developed using Streamlit to visualise electricity demand forecasts, trends, and key demand drivers. The results showed that lagged electricity demand was by far the strongest predictor of future demand, with the one-year lag achieving a near-perfect Pearson correlation of 0.999 with the target variable. Among structural climate and socioeconomic predictors, population size and its three-year rolling mean were the strongest predictors of electricity demand, followed by the three-year rolling mean of temperature, the interaction between population and electricity access, and the temperature-urbanisation interaction. Linear Regression on the full multivariate feature set achieved the best overall test set performance, with a log-scale MAPE of 6.01% and an R^2 of 0.996 (note: all metrics are on the log-transformed demand scale, not in original TWh units), and was selected as the final model for the dashboard. The study confirms that annual electricity demand in Sub-Saharan Africa is extremely persistent, lagged demand provides most of the predictive power in the model. Climate and socioeconomic variables contain substantial structural information about demand patterns when historical demand is unavailable, but contribute little additional one-year-ahead predictive accuracy once lagged demand is already included. This distinction between predictive accuracy and structural explanation is the core finding of the study.
dc.description.sponsorshipSelf sponsored
dc.identifier.urihttps://hdl.handle.net/20.500.11951/2454
dc.language.isoen
dc.publisherUganda Christian University
dc.rightsAttribution-NonCommercial-NoDerivs 3.0 United Statesen
dc.rights.urihttp://creativecommons.org/licenses/by-nc-nd/3.0/us/
dc.subjectElectricity demand forecasting
dc.subjectSub-Saharan Africa
dc.subjectMachine learning
dc.subjectPanel time-series data
dc.subjectClimate and socioeconomic variables
dc.subjectFeature engineering
dc.subjectWalk-forward validation
dc.subjectDecision-support dashboard
dc.titleMachine Learning Forecasting for Electricity Demand Using Climate and Socioeconomic Data in Sub-Saharan Africa
dc.typeDissertation

Files

Original bundle

Now showing 1 - 2 of 2
No Thumbnail Available
Name:
Lordin Lutalo_Post viva corrections form.pdf
Size:
505.06 KB
Format:
Adobe Portable Document Format
No Thumbnail Available
Name:
Machine_Learning_Forecasting_for_Electricity_Demand_Using_Climate_and_Socioeconomic_Data_in_Sub_Saharan_Africa.pdf
Size:
5.16 MB
Format:
Adobe Portable Document Format

License bundle

Now showing 1 - 1 of 1
No Thumbnail Available
Name:
license.txt
Size:
1.71 KB
Format:
Item-specific license agreed upon to submission
Description: