# An ANN Model Trained on Regional Data in the Prediction of Particular Weather Conditions
## 3 Materials and Methods
### Data Preprocessing  
The input data were normalized, and the five selected daily weather conditions were forecasted for the full 2018, 2019, and 2020 years. The study includes daily short-term forecasts for the next day. MLP was used as a prediction model. To evaluate the prediction accuracy, the results were compared with the values of measurements made available by the Institute of Meteorology and Water Management (IMGW). One stage of data preparation, preceding the use in machine learning, was the preprocessing. \begin{table}
\begin{tabular}{l c c} \hline \hline
**Dataset** & **Number of Samples** & **\% of Total Dataset** \\ \hline Training & 2554 & 69.97\% \\ Test & 1096 & 30.03\% \\ \hline Total & 3650 & 100\% \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Dimensions of the datasets used for training and testing the Multilayer Perceptron (MLP) model. \begin{table}
\begin{tabular}{l l l} \hline \hline  & **Training Feature** & **Unit** \\ \hline
1. & Maximum daily temperature & degrees Celsius [\({}^{\circ}\)C] \\
2. & Minimum daily temperature & degrees Celsius [\({}^{\circ}\)C] \\
3. & Mean daily temperature & degrees Celsius [\({}^{\circ}\)C] \\
4. & Minimum daily temperature at ground level & degrees Celsius [\({}^{\circ}\)C] \\
5. & Daily sum of precipitation & millimeters [mm] \\
6. & Daily dew duration & hours [h] \\
7. & Mean daily general cloud cover & octants [octants] \\
8. & Mean daily wind speed & meters per second [m/s] \\
9. & Mean daily relative humidity & percentages [\%] \\
10. & Mean daily atmospheric pressure at the station level & hetopascals [hPa] \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Features of the training dataset (inputs for the MLP model). \begin{table}
\begin{tabular}{l l} \hline \hline  & **Predicted Condition** & **Unit** \\ \hline
1. & Maximum daily temperature & degrees Celsius [\({}^{\circ}\)C] \\
2. & Minimum daily temperature & degrees Celsius [\({}^{\circ}\)C] \\
3. & Mean daily atmospheric pressure at station level & hetopascals [hPa] \\
4. & Mean daily wind speed & meters per second [m/s] \\
5. & Daily sum of precipitation & millimeters [mm] \\ \hline \hline \end{tabular}
\end{table} 
Table 3: The weather conditions selected for the prediction in the MLP model. With data concerning the daily precipitation sum, the lack of precipitation was recorded in files downloaded from IMGW as the lack of a value, which is interpreted in Python as a NaN value (Not a Number--value not being a number). It was, therefore, necessary to take measures to obtain the correct results of the implemented models with the data used. Missing values, with precipitation data, were completed with 0. No missing data were found for the other parameters available in the dataset. However, if some weather data were missing, a suitable solution to fill them in would be to use the \(k\)-Nearest Neighbors algorithm for the specificity of successive weather variables in time. In the next step, the dataset was divided into the training and test dataset. Normalization of the Input Data  
Neural networks generally provide better performance when working on normalized data. Using the original data as the input to a neural network may cause algorithm convergence problems. The absence of a normal distribution is a common occurrence for environmental data [77]. Python provides several classes in which data scaling procedures are implemented. One of these procedures is a method that allows for parametric, monotonous transformations, the aim of which is to map data from any distribution to as close as possible to the Gaussian distribution to stabilize the variance and minimize the skew. This method belongs to a new power transformation family that is well defined on the whole actual line and is appropriate for reducing skewness to approximate normality. It has properties similar to those of the Box-Cox transformation for positive variables. The large-sample properties of the transformation were investigated in a single random sample [78].