Toward sustainable energy production: a comparative machine learning framework for predicting green hydrogen cost across the african continent

A Ashraf M. T. Elewa M Moustafa Gamal Snousy A Ahmed M. Saqr H Hussein M. Elshafie A Ashraf R. Abouelmagd A Ali Mahmoud Hussain T Tarek Abd El-Hafeez

Abstract

Abstract Rapid decarbonisation of hard-to-electrify sectors requires low-emission hydrogen, but deployment is constrained by uncertainty in the Levelized Cost of Hydrogen (LCOH) across diverse national contexts. Using Africa as a case study, where green hydrogen planning spans highly heterogeneous conditions, this study develops a comparative machine learning framework for country-scale cost screening before major infrastructure commitments. A harmonized dataset of 54 African scenarios was compiled, with LCOH (EUR/kg) as the target variable and 14 predictors capturing project scale, renewable capacity, storage and transport infrastructure, investment and maturity stage, energy security and sustainability indices, market variables, CO 2 reduction potential, and water demand. The workflow integrated exploratory statistics, preprocessing, and systematic benchmarking of 11 regression models using an independent 20% holdout split, complemented by repeated nested cross-validation. Across the compiled cases, LCOH ranged from 3.75 to 5.60 EUR/kg with a median of 4.90 EUR/kg, showing clear cost stratification by project maturity stage. Holdout validation identified Hyperopt optimized Gradient Boosting as the best performing model (R 2  = 0.9762, RMSE = 0.0840 EUR/kg, MAE = 0.0663 EUR/kg), followed closely by Bayesian tuned XGBoost (R 2  = 0.9713). Nested cross-validation confirmed model stability (Hyperopt_GB: R 2  = 0.9710 ± 0.032). SHAP analysis revealed that renewable energy capacity, electrolyser capacity, and the energy security index contributed most to predicted LCOH variability within the dataset. The framework provides a transferable screening pipeline for prioritizing investment and data collection in data-scarce settings, with explicit linkages to Sustainable Development Goal (SDG) relevant indicators, including energy security, climate mitigation, and water stress. This approach complements deterministic techno-economic appraisal by enabling rapid cross-country comparison during early-stage planning Fig.S1.

Article Details

Volume / Issue Vol. 16, Issue 1
Published April 17, 2026
ISSN 2045-2322
Publisher Nature Portfolio

Journal Info

Scientific Reports

Nature Portfolio

ISSN: 2045-2322 Open Access Life Sciences

Authors (7)

A

Ashraf M. T. Elewa

M

Moustafa Gamal Snousy

A

Ahmed M. Saqr

H

Hussein M. Elshafie

A

Ashraf R. Abouelmagd

A

Ali Mahmoud Hussain

T

Tarek Abd El-Hafeez