Prediksi Curah Hujan menggunakan Extreme Gradient Boosting (XGBoost) dan Interpretasi Large Language Model sebagai Pendukung Mitigasi Banjir di Kota Semarang
Abstract
Rainfall is one of the factors associated with flooding in Semarang City, so information about future rainfall conditions is needed to support preparedness and mitigation. This study implements Extreme Gradient Boosting (XGBoost) to predict daily rainfall using historical rainfall observations obtained from the Meteorology, Climatology, and Geophysics Agency (BMKG) and integrates a Large Language Model (LLM) through Gemini AI to interpret prediction results. The research stages consist of data preparation, cleaning, feature engineering, model development, hyperparameter optimization, evaluation, iterative forecasting, and LLM-based interpretation. The model uses eight input features, namely RR_t-1, RR_t-2, RR_t-3, RR_t-7, rolling_3, rolling_7, sin_bulan, and cos_bulan, with the target transformed using log1p(). RandomizedSearchCV with TimeSeriesSplit was applied to evaluate 30 hyperparameter combinations using five folds. The final evaluation produced an MAE of 5.1502 mm, RMSE of 11.8584 mm, and R² of 0.7458. The model was subsequently used to forecast rainfall for 60 days ahead. The predicted daily values were summarized by month and interpreted by Gemini AI to provide descriptive information, an indicative flood-risk level, and mitigation recommendations. The resulting system provides not only numerical rainfall predictions but also contextual information that is easier for users to understand as supporting information for flood mitigation in Semarang City.