Machine Learning for Forecasting Hydrogen Production From Solar Energy Using K-Nearest Neighbors Regression Model: a Case Study in Petrolina, Brazil

Almeida, Gabriel de Oliveira, Viana, Tainan Sousa, Thé, Jesse Van Griensven, Silva, Maria Eugênia Vieira, Rocha, Paulo Alexandre Costa

ISES Solar World Congress 2025 · Fortaleza, Brazil · 2025-11-03
Published by International Solar Energy Society (ISES)
DOI: 10.18086/swc.2025.04.31

Abstract

This paper proposes the application of the kNN regression machine learning algorithm to predict green hydrogen production in the city of Petrolina, Pernambuco. Solar irradiance data were applied to a mathematical model that considers a PEM electrolyzer powered by photovoltaic panels, resulting in a time series of production rates. These values were applied along with temporal information as predictor variables. A bagging approach was applied so that the final forecast response is given by the average of the individual responses of ten models created from random samples of the training set. The process was repeated for different sampling intervals, and the results were evaluated according to performance metrics. The best result was obtained for an interval of 20 minutes, obtaining the values of RMSE, nRMSE and R² equal to 75.144 kg km-^2 , 0.212 and 0.826, respectively. When compared to other papers, the performance of our model is inferior to more robust approaches, such as support vector machines and neural networks, but it presents competitive performance under certain conditions of the prophet model and outperforms another kNN model employed for the same purpose.

Keywords

Solar energy, green hydrogen, times series forecasting, machine learning, kNN regression model

Download full text (PDF)

← All proceedings papers