# In the phase of testing
## 4 Implementation and Results
### Data Preparation and Implementation  
We applied many steps. Firstly, we addressed the null values in some records. We replaced the null value with the average one. Then, we used standardized and normalizing functions for digital variables (temperature, relative humidity, wind velocity, and rain total amount). Normalization and standardization isolate the effect of the difference in ranges between values of variables (See Equations (1) and (2)). After that, we tested the coalition between each feature (variable) and classification column (\(\Upsilon\)). We excluded the variables with a correlation of less than 0.6 as sea level mean and humidity. This is logical because all data is related to the same city (Jeddah), so the sea level does not have any impact on records. Moreover, we customize our framework to deal with the small area (fog cells) instead of the city for considering the difference in areas' topology. In addition, we converted the nominal values, including dates, to numeric, where we replaced the date with the month number because each month has different behavior in Saudi Arabia. Finally, we dealt with the imbalanced data issue, where there are 3652 records classified as \"no flood\" (0) compared to 92 records as 'flood' (1). Many real-world domains have an imbalanced data problem, and combating imbalanced data is critical because it will negatively affect the machine learning process and drive errors in classification or prediction [39]. We applied the SMOTE technique to solve the imbalanced issue. The data was divided into 80% for training and 20% for testing, where a different 20% is chosen each time of testing to cover all data and enhance the results' reliability. Then, we selected five of the most popular ML models for classification targets. The selected models are Support Vector Machine (SVM), K-Nearest Neighbor (KNN), Decision Tree (DT), Rain Forest (RF), and Liner Regression (LR). Moreover, we added Deep Learning model (DL). We used Python programing language with the Google COLAB platform (Cloud Platform). We applied the selected ML models to the final dataset and selected the best three models that gave the highest performance according to many metrics (accuracy, precision, recall, F-Score, and ROC curve). The best three models were DT, RF, and KNN. To enhance the accuracy and reliability of our algorithm, we depend on testing the actual value (input data formed by a fog) on these three models together. That means, the final result will depend on the majority of classification results of the three models. For example, if two \begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline
**Date** & **Month (No)** & **Temperature (Deg. C) (M)** & **Humidity (\%) (M)** & **Wind Speed** & **Sea Level** & **Rain-Total** & **Class** \\
25 November 2009 & 11 & 25.5 & 84 & 7 & 1010.8 & 70.000 & 1 \\
25 December 2010 & 12 & 25.0 & 53 & 6 & 1013.8 & 33.000 & 1 \\
18 July 2011 & 7 & 34.4 & 57 & 7 & 1002.4 & 0.001 & 0 \\
3 November 2012 & 11 & 29.5 & 62 & 4 & 1010.4 & 34.200 & 1 \\
23 February 2013 & 2 & 25.3 & 65 & 4 & 1011.5 & 0.001 & 0 \\
17 April 2018 & 4 & 29.8 & 61 & 5 & 1008.2 & 38.000 & 1 \\
8 May 2019 & 5 & 30.0 & 58 & 8 & 1006.8 & 0.001 & 0 \\
3 June 2020 & 6 & 30.3 & 59 & 9 & 1005.2 & 0.001 & 0 \\
3 July 2021 & 7 & 42 & 70 & 16 & 1001.1 & 0.001 & 0 \\
3 August 2022 & 8 & 46 & 65 & 9 & 1000.6 & 0.001 & 0 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Shape of dataset of Jeddah city weather for 10 years (2009–2013 and 2018–2022) (e.g., of nine rows). of them give 1 and the third gives 0, then the result will be 1. In addition, we considered threats classification early before they become a disaster. \[Standardization\;NewX=\frac{Xi-Mean(X)}{Standard\;Deviation} \tag{1}\]  
\[Normalization\;NewX=\frac{Xi-Min(X)}{Max(X)-Min(X)} \tag{2}\]  
For comparison and evaluation between the models, we used standard metrics, which are confusion matrix and ROC curve (ROC), in addition to learning curve.