A 72-Hour Temperature Forecasting System for Benghazi Using LSTM and Random Forest Models
Keywords:
Temperature Forecasting, LSTM, Random Forest, Time Series, Machine Learning, ERA5Abstract
Accurate short-term temperature forecasting plays a critical role in urban climate management, energy optimization, and early warning systems. This study proposes a machine learning–based framework for 72-hour ahead maximum temperature prediction in Benghazi, Libya, using Random Forest (RF) and Long Short-Term Memory (LSTM) models. A five-year daily dataset (2021–2025), derived from ERA5 reanalysis and NOAA data, was used. A sliding window approach (30-day lookback) and chronological 80/20 train–test split ensured realistic forecasting conditions. Results show that LSTM outperforms RF with MAE = 1.25°C, RMSE = 1.82°C, and R² = 0.84. Statistical analysis confirms the significance of this improvement (p < 0.001). The proposed system demonstrates strong potential for short-term urban climate forecasting in Mediterranean environments.










