Rainfall Prediction Based on an Improved XGBoost Model Using Climate Data
Abstract
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.