Rainfall Prediction Based on an Improved XGBoost Model Using Climate Data
DOI:
https://doi.org/10.54097/gb2s8a09Keywords:
Rainfall Prediction, Climate Data, XGBoost, Feature Engineering, Class Imbalance, Machine LearningAbstract
Rainfall prediction is an important classification problem in meteorology, with practical applications in agriculture, water management, flood warning, and urban planning. Predicting rainfall is difficult because variables such as temperature, humidity, pressure, wind, and time are related in complex and often nonlinear ways. In this study, the WeatherAUS dataset was used to develop a machine-learning framework for predicting rainfall on the following day. The workflow includes data preprocessing, meteorological feature construction, treatment of class imbalance, and parameter adjustment for an Extreme Gradient Boosting (XGBoost) classifier. Logistic Regression, Decision Tree, Random Forest, and standard XGBoost models were used for comparison. Their performance was examined using accuracy, precision, recall, F1 score, ROC-AUC, and confusion matrices. Because missing a rainy day is important in practical forecasting, particular attention was given to the recall of the rain class. On the test set, the improved XGBoost increased rainy-day recall from 0.524 to 0.670, while false negatives fell from 839 to 581. However, this change also resulted in lower precision and accuracy than the standard XGBoost. The results therefore show a clear trade-off: the modified model detects more rainfall events, but it also produces more false alarms.
Downloads
References
[1] Kong, Q., Awange, J., Li, Q., Mi, X., Bai, Q., Wang, S., Yang, Y., & Bo, G. (2025). A novel optimized hybrid VMD-PCA-XGBoost model for forecasting precipitation: Exemplified by the Beijing-Tianjin-Hebei study region in China. IEEE Journal of Selected Topics in Applied Earth Observations and Remote Sensing, 18, 17154–17165. https://doi.org/10.1109/JSTARS.2025.3586351. DOI: https://doi.org/10.1109/JSTARS.2025.3586351
[2] Tadayon, A., Nazari, M., & Kerachian, R. (2025). Enhancing long-lead rainfall forecasting in data-scarce large watersheds using multi-model fusion. Journal of Hydrology: Regional Studies, 62, 102936. https://doi.org/10.1016/j.ejrh.2025.102936. DOI: https://doi.org/10.1016/j.ejrh.2025.102936
[3] Gao, Y., Wang, D., Huang, L., & Li, E. (2025). Applying XAI to optimized XGBoost models: Elucidating multi-type predictor impacts for short-term precipitation forecast. Journal of Tropical Meteorology, 31, 603–621. https://doi.org/10.3724/j.1006-8775.2025.040. DOI: https://doi.org/10.3724/j.1006-8775.2025.040
[4] Zhu, Y., & Zhang, D. (2025). Application of fusion neural network based on XGBoost correction in precipitation prediction. People's Pearl River. (in Chinese)
[5] Chen, T., & Guestrin, C. (2016). XGBoost: A scalable tree boosting system. In Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining (pp. 785–794). San Francisco, CA, USA. https://doi.org/10.1145/2939672.2939785. DOI: https://doi.org/10.1145/2939672.2939785
[6] He, H., & Garcia, E. A. (2009). Learning from imbalanced data. IEEE Transactions on Knowledge and Data Engineering, 21(9), 1263–1284. https://doi.org/10.1109/TKDE.2008.239. DOI: https://doi.org/10.1109/TKDE.2008.239
[7] Chawla, N. V., Bowyer, K. W., Hall, L. O., & Kegelmeyer, W. P. (2002). SMOTE: Synthetic minority over-sampling technique. Journal of Artificial Intelligence Research, 16, 321–357. https://doi.org/10.1613/jair.953. DOI: https://doi.org/10.1613/jair.953
[8] Pedregosa, F., et al. (2011). Scikit-learn: Machine learning in Python. Journal of Machine Learning Research, 12, 2825–2830. https://doi.org/10.5555/1953048.2078195.
[9] Young, J. (n.d.). Rain in Australia. Kaggle dataset. https://www.kaggle.com/datasets/jsphyg/weather-dataset-rattle-package. Accessed June 3, 2026.
[10] Akiba, T., Sano, S., Yanase, T., Ohta, T., & Koyama, M. (2019). Optuna: A next-generation hyperparameter optimization framework. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining (pp. 2623–2631). https://doi.org/10.1145/3292500.3330701. DOI: https://doi.org/10.1145/3292500.3330701
[11] Breiman, L. (2001). Random forests. Machine Learning, 45(1), 5–32. https://doi.org/10.1023/A:1010933404324. DOI: https://doi.org/10.1023/A:1010933404324
[12] Friedman, J. H. (2001). Greedy function approximation: A gradient boosting machine. Annals of Statistics, 29(5), 1189–1232. https://doi.org/10.1214/aos/1013203451. DOI: https://doi.org/10.1214/aos/1013203451
[13] Fawcett, T. (2006). An introduction to ROC analysis. Pattern Recognition Letters, 27(8), 861–874. https://doi.org/10.1016/j.patrec.2005.10.010. DOI: https://doi.org/10.1016/j.patrec.2005.10.010
[14] Davis, J., & Goadrich, M. (2006). The relationship between precision-recall and ROC curves. In Proceedings of the 23rd International Conference on Machine Learning (pp. 233–240). Pittsburgh, PA, USA. https://doi.org/10.1145/1143844.1143874. DOI: https://doi.org/10.1145/1143844.1143874
[15] Saito, T., & Rehmsmeier, M. (2015). The precision-recall plot is more informative than the ROC plot when evaluating binary classifiers on imbalanced datasets. PLOS ONE, 10(3), e0118432. https://doi.org/10.1371/journal.pone.0118432. DOI: https://doi.org/10.1371/journal.pone.0118432
[16] Jolliffe, I. T., & Stephenson, D. B. (2012). Forecast verification: A practitioner's guide in atmospheric science (2nd ed.). Wiley. DOI: https://doi.org/10.1002/9781119960003
[17] Wilks, D. S. (2011). Statistical methods in the atmospheric sciences (3rd ed.). Academic Press. DOI: https://doi.org/10.1016/B978-0-12-385022-5.00001-4
Downloads
Published
Issue
Section
License
Copyright (c) 2026 Frontiers in Computing and Intelligent Systems

This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.

