1. INTRODUCTION
rapid land-use change and urban sprawl can increase flooding, drainage failures, traffic disruption, property damage, and risks to human life when forecasts are inadequate [3].
Precipitation is a vital hydrological process on Earth. Accurate forecasts are central to agricultural production, environmental protection, hydrological infrastructure, emergency response, and public policy. Rainfall is the primary source of freshwater and governs processes that support ecosystem health and sustainable communities [1]. Agricultural planning, reservoir management, drainage control, and disasterwarning systems all depend on reliable rainfall information. In rain-fed regions, sub-seasonal forecasts can inform agricultural planning and on-farm decisions [2]. In urban areas,
Rainfall anomalies are among the consequential effects associated with a changing climate. Their impacts include flash floods, landslides, prolonged droughts, fires, and agricultural disruption [4]. A warmer atmosphere can hold more moisture and intensify the hydrological cycle, increasing uncertainty and the likelihood of short, intense rainfall events as well as longer dry periods [5]. Timely forecasts can therefore provide substantial benefits to vulnerable communities and environmentally sensitive regions [6].
Rainfall prediction is challenging because many interacting variables influence precipitation, including temperature, humidity, barometric pressure, wind, cloud cover, and atmospheric circulation. Large-scale ocean–atmosphere systems such as ENSO, IOD, and NAO also affect rainfall patterns [7]. The resulting system has spatial and temporal dependencies and nonlinear, non-stationary behavior [8]. Traditional Numerical Weather Prediction (NWP) models use physical equations to represent atmospheric dynamics. Although theoretically powerful, they require substantial computing resources and can struggle to resolve localized phenomena such as convective storms and mountain-influenced weather. Uncertain parameterizations and boundary conditions can also cause differences between forecast and observed rainfall, particularly for short-term or localized events [9].
These limitations have encouraged the use of data-driven Machine Learning (ML) and Deep Learning (DL) methods. Rather than relying solely on explicit physical-process models, these approaches learn statistical patterns from observations and can model high-dimensional, noisy, and nonlinear data. Support Vector Machines, decision trees, Random Forests, Gradient Boosting, and XGBoost have been applied to rainfall prediction, while recurrent architectures such as Long Short-Term Memory (LSTM) and Gated Recurrent Unit networks can learn temporal patterns [10, 11, 12]. Their performance nevertheless depends on the quality, quantity, and representativeness of the input data.
This study develops a dataset and evaluates machine-learning approaches for next-day rainfall prediction using daily observations from major urban and semi-urban centers across the United States during 2024–2025. Each record includes temperature, humidity, wind speed, pressure, cloud cover, and precipitation, as well as a binary Rain Tomorrow label. The study compares classifiers under a common evaluation framework and uses SHAP values to explain model predictions. The analysis aims to connect machine-learning methods with practical hydrometeorological forecasting and to identify models that can support future operational systems [13].
2. LITERATURE REVIEW
Rainfall prediction is important for flood preparedness, agricultural planning, water-resource management, and disaster risk reduction. Because precipitation is shaped by interacting atmospheric and terrestrial factors, data-driven ML and DL approaches are increasingly used alongside traditional statistical and physical models.
Barrera-Animas et al. compared conventional ML models with temporal neural architectures for hourly rainfall prediction using data from five UK cities covering 2000– 2020. Their study evaluated LSTM, Stacked-LSTM, and Bidirectional-LSTM models alongside tree ensembles and support-vector regression; Bidirectional-LSTM and Stacked-LSTM performed well in accuracy and computational efficiency [14]. For Nigeria, Ojo and Ogunjo compared Multivariate Polynomial Regression, Artificial Neural Networks, ANFIS, SVM, and autoregressive approaches using 31 years of rainfall data. ANFIS performed best across ten consecutive months, illustrating the potential of hybrid fuzzy methods for seasonal and regional prediction [15].
For Saudi Arabia, Baljon and Sharma evaluated machinelearning classifiers for rainfall prediction using historical meteorological data; their decision-tree classifier achieved 96.1% accuracy [16]. Akhtar et al. proposed a CNN optimized with Adaptive Searched Scaling factor-based Elephant Herding Optimization, automatically tuning network structure and related parameters. Their results demonstrated the potential of evolutionary optimization for rainfall prediction [17]. Allawi et al. compared ANN models optimized with Artificial Bee Colony, Particle Swarm Optimization, and Imperialist Competitive Algorithm using 54 years of Malaysian monthly rainfall data; ICA-ANN produced the strongest comparative results [18].
Chen et al. compared LSTM and Random Forest for rainfall prediction in the distinct climatic regions of Rize and Konya, Turkey. Their 41-year time-series evaluation found that LSTM performed well across several hydrological metrics [19]. Tuysuzoglu et al. introduced an ensemble K-star classifier with probability-based aggregation and feature selection for next-day categorical rainfall prediction [20]. Ahmadi et al. studied ensemble variants of SMO regression in Iran and identified minimum relative humidity as an influential variable [21]. Satheesh et al. examined the predictability of synoptic-scale rainfall during the West African summer monsoon using a data-driven statistical forecast based on spatiotemporal patterns in satellite rainfall. Their forecast outperformed climatology and operational ensemble benchmarks along the fringes of the rainbelt, while skill remained poor within the main rainbelt [22].
For China’s Taihu Basin, Gu et al. combined KNN, XGBoost, SVR, or ANN base learners in a stacking ensemble and incorporated local meteorological factors and climate indices [23]. Alqahtani et al. developed a CNN–Bidirectional-LSTM hybrid for rainfall prediction in the environmentally sensitive wetlands of southern Iraq [24]. Mohamadi et al. studied rainfall prediction using multiple inclusive models and large climate indices [25]. Related work in the Sefidrood Basin combined RBFNN and MLP models with NMR, PSO, FFA, and GA optimization, reducing RMSE by up to 72% compared with standalone models [25]. Johny et al. combined Multivariate Empirical Mode Decomposition, Time Dependent Intrinsic Cross Correlation, and LSTM with ENSO and IOD indices for all-India rainfall analysis, reporting skill 0.98, NSE 0.95, and IA 0.91 [26].
Other studies have addressed related hydrological prediction tasks. Zhao et al. evaluated 17 ML algorithms for rainfalldriven debris-flow prediction in central China; Extra Trees performed well on their event dataset [27]. Roy et al. compared metaheuristic ANFIS models for runoff prediction in UK river basins and reported strong validation performance for biogeography-based optimization [28]. Collectively, these studies illustrate the value of multivariate inputs, nonlinear learners, ensembles, and hybrid optimization. The present work focuses on next-day rainfall classification and complements prediction metrics with SHAP-based interpretation.
3. DATASET AND PREPROCESSING
3.1 Dataset Description
The study uses the USA Rainfall Prediction Dataset, which co-
ntains daily weather observations from 20 major U.S. cities for 2024 and 2025 [29]. The data are intended to support temporal analysis, seasonal-pattern recognition, and rainfallevent prediction. The target variable, Rain Tomorrow, is binary: 1 indicates rainfall the following day, and 0 indicates no rainfall. The six meteorological input features are:
- Temperature: daily average surface-air temperature in degrees Fahrenheit.
- Humidity: relative atmospheric humidity, expressed as a percentage.
- Wind speed: surface wind movement, measured in miles per hour.
- Precipitation: rainfall observed during the measurement period, in inches.
- Cloud cover: percentage of the sky covered by clouds.
- Pressure: barometric pressure in millibars.
Figure 1 shows the distribution of the target classes. Norain observations outnumber rain observations, so the dataset has class imbalance. Figure 2 shows the Pearson correlations among the numerical meteorological features. Most pairwise linear relationships are small, suggesting limited multicollinearity among the predictors; rainfall relationships may nevertheless be nonlinear.
3.2 Data Preprocessing
The original dataset contained no missing values. To make the workflow reproducible and extensible, the preprocessing strategy nevertheless included conditional missing-value handling. Numerical variables such as temperature, humidity, wind speed, and pressure were to be imputed with their column means using the SimpleImputer class from scikitlearn. Mode imputation or forward filling could be used for categorical or datetime variables if required [30].
The data types were checked for compatibility with the machine-learning pipeline. Continuous variables were represented numerically, while the categorical target Rain Tomorrow was encoded as an integer. Conversion steps ensured that inputs met the data requirements of each classifier.
3.3 Feature Engineering
The selected input variables were temperature, humidity, wind speed, precipitation, cloud cover, and pressure. These features represent both immediate weather conditions and factors associated with rainfall formation. Feature-importance scores from tree-based models, including Random Forest and XG-Boost, indicated that precipitation and humidity were the most influential variables. This ranking is consistent with the role of atmospheric moisture and observed precipitation in rainfall patterns. Feature-importance analysis can also inform later variable reduction, interaction construction, or parameter optimization.
4. RESULTS AND DISCUSSION
This section evaluates six classifiers on the USA Rainfall Prediction Dataset (2024–2025). The binary classification task predicts whether rainfall will occur the following day. Precision, recall, and F1-score are used to compare predictive performance, and confusion matrices, ROC curves, Precision– Recall curves, and SHAP visualizations provide additional diagnostic and interpretability analyses.
4.1 Evaluation Metrics
Precision measures the fraction of predicted rain events that are correct:
Precision = TP TP+FP, (1) where TP denotes true positives and FP false positives. High precision corresponds to fewer false rain alerts.
Recall measures the fraction of actual rain events identified correctly:
Recall = TP TP+FN , (2) where FN denotes false negatives. High recall means that fewer rainy days are missed.
The F1-score is the harmonic mean of precision and recall:
F1 = 2 Precision×Recall
Precision+Recall. (3)
It provides a single summary of the balance between falsepositive and false-negative behavior, which is useful when class frequencies are unequal.
4.2 Applied Machine-Learning Models
Six classifiers were evaluated:
1. Random Forest: An ensemble of decision trees trained using bootstrap samples and randomized feature selection. Voting across trees supports generalization and helps limit overfitting. In this evaluation, Random Forest achieved precision, recall, and F1-score values of 1.00. 2. Logistic Regression: A linear baseline that estimates class probabilities with the logistic (sigmoid) function. Its F1-score was 0.77. 3. RBF Support Vector Machine: A kernel-based classifier that can represent nonlinear decision boundaries. It achieved precision of 0.98, recall of 0.97, and an F1-score of 0.97. 4. k-Nearest Neighbors (KNN): A non-parametric method that assigns a class by voting among nearby observations. It achieved an F1-score of 0.94. 5. Naive Bayes: A probabilistic classifier based on Bayes’ theorem and a conditional-independence assumption. It achieved precision of 0.96, recall of 0.63, and an F1-score of 0.76. 6. Linear SVM: A maximum-margin linear classifier. It achieved precision of 0.84, recall of 0.71, and an F1-score of 0.77.
4.3 Classification Results
Table 1 summarizes the reported precision, recall, and F1score values. Random Forest achieved the highest scores, while RBF SVM and KNN also performed strongly. Logistic Regression and Linear SVM had identical reported results.
Naive Bayes combined high precision with lower recall, indicating that it missed a larger share of actual rain events.
Model Precision Recall F1-score Random Forest 1.00 1.00 1.00 Logistic Regression 0.84 0.71 0.77 SVM (RBF) 0.98 0.97 0.97 KNN 0.95 0.93 0.94 Naive Bayes 0.96 0.63 0.76 Linear SVM 0.84 0.71 0.77
Figure 3 compares the true and predicted class labels. Random Forest shows no errors in the displayed matrix. The RBF SVM and KNN matrices contain relatively few errors, whereas Logistic Regression, Linear SVM, and Naive Bayes miss more rain events. These patterns complement the aggregate precision and recall results.
The Receiver Operating Characteristic (ROC) curve describes the relationship between the true-positive rate and falsepositive rate as the decision threshold varies. The curves in Figure 4 report AUC values of 1.00 for Random Forest, RBF SVM, and KNN; 0.98 for Naive Bayes; and 0.95 for Logistic Regression and Linear SVM. ROC–AUC complements fixedthreshold measures by summarizing discrimination across thresholds.
Precision–Recall analysis is especially informative when positive and negative classes are imbalanced. Figure 5 shows the trade-off between precision and recall over classification thresholds. The reported average-precision (AP) values are 1.00 for Random Forest and RBF SVM, 0.98 for KNN, 0.94 for Naive Bayes, and 0.86 and 0.85 for Logistic Regression and Linear SVM, respectively. Naive Bayes retains
(a) Random Forest (b) SVM (RBF) (c) K-Nearest Neighbors
(d) Naive Bayes (e) Logistic Regression (f) Linear SVM
(a) Random Forest (b) SVM (RBF) (c) K-Nearest Neighbors
(d) Naive Bayes (e) Logistic Regression (f) Linear SVM
high precision over part of the recall range but declines as recall increases, consistent with its lower recall at the selected threshold.
4.4 SHAP Interpretation
SHAP interaction values describe both individual feature contributions and pairwise effects on a model’s output. Figure 6 shows the interaction between temperature and humidity. The plotted interaction values vary around zero, indicating that these variables can have joint effects even when their individual contributions are small.
Figure 7 presents the SHAP summary plot, ranking features by their contributions across observations.
Precipitation and humidity have the greatest influence on the predictions, followed by wind speed and temperature; cloud cover and pressure have smaller contributions overall. The color gradient represents feature values, while the horizontal position shows the direction and magnitude of SHAP impact. This pattern is consistent with the expected meteorological influence of precipitation and atmospheric moisture.
5. CONCLUSION AND FUTURE WORK
This study presented an interpretable machine-learning framework for next-day rainfall classification using daily observations from 20 U.S. cities during 2024–2025. Random Forest produced the highest reported precision, recall, and F1-score, each equal to 1.00. SHAP explanations identified precipitation and humidity as the leading contributors to predictions, making the model’s outputs more transparent. RBF SVM and KNN also achieved strong results, while Logistic Regression, Linear SVM, and Naive Bayes showed lower F1-scores.
Accurate forecasts paired with interpretable explanations could support agricultural planning, urban development, emergency response, and water-resource management. Future work may examine hybrid metaheuristic optimization methods such as Genetic Algorithms, Particle Swarm Optimization, and Biogeography-Based Optimization; incorporate streaming observations for real-time updates; and test scalability across larger geographic areas and longer observation periods.