Continuous Rainfall Prediction Using Stacked LSTM and Sliding Window Time Series Modeling - Akrom Akrom; Dimas Lendensi; Abdullah Muhajir; Riky Susanto (Information Technology and Science (ITScience), 2026)
Rainfall prediction plays an important role in supporting decision-making in agriculture, water resource management, and disaster mitigation. However, the increasing variability of rainfall patterns makes accurate forecasting a challenging task. This study aims to implement a Long Short-Term Memory (LSTM) model for rainfall prediction based on time series data and to evaluate its performance using regression metrics. The dataset consists of 600 monthly rainfall observations, which were preprocessed through normalization and transformed using a sliding window technique with a time step of 30. The data were divided into training and testing sets with a ratio of 80:20. The proposed model employs a stacked LSTM architecture with dropout regularization and is trained for 50 epochs. The experimental results show that the model achieves satisfactory predictive accuracy, with a Train RMSE of 1.1009 and a Test RMSE of 0.6846, as well as a Train MAE of 0.6000 and a Test MAE of 0.4837. The results indicate that the model is capable of capturing temporal patterns and fluctuations in rainfall data. Therefore, the LSTM-based approach can be considered an effective method for rainfall prediction and has potential applications in environmental forecasting systems.