Gabriel W C Rocha, Alberto B DE Palhares Júnior, Joab M Varela, Eliardo G DA Costa, Rafael Chaves
Floods are among the most destructive natural disasters, necessitating accurate and timely prediction systems to mitigate their impact. This study evaluates the performance of two machine learning models, - K-Nearest Neighbors (KNN) and Long Short-Term Memory (LSTM) networks - in predicting daily water levels based on hydrological and meteorological data from the Wupper River in Wuppertal, Germany. The KNN model yielded the best accuracy (R2 = 0.97; MAE = 1.65; RMSE = 2.84). Owing to its lazy-learning nature, KNN incurs negligible training cost but requires full dataset storage and high computational effort during inference due to repeated distance evaluations. In contrast, the LSTM model (optimal window t = 1 day) reached R2 = 0.84, MAE = 4.19, and RMSE = 6.84. Unlike KNN, the LSTM forms an explicit parametric model during training - an expensive step - but produces fast predictions once deployed.