# Micro-Location Temperature Prediction Leveraging Deep Learning Approaches
## 3 Proposed Method Maximus  
Theoretically, the weather prediction models in our study were obtained by a workflow of the processes illustrated in Figure 5. The workflow demonstrates a systematic approach for developing an ML model for temperature prediction based on weather data [13]. Here, the weather forecasting starts with acquiring meteorological data from the CERRA datasets. These meteorological data are then entered into the preprocessing step, where issues such as missing values are eliminated, improving data quality and preparing them for processing with various ML methods. Typically, model training using RNN, LSTM, or GRU NNs serve for weather prediction purposes. The next step presents an evaluation of the model, in which the quality of the created model is estimated. As a final step, the optimal model based on evaluation metrics is chosen, and used as the prediction model, supplemented with the ICON-D2 dataset and real weather data from a mobile weather station to perform continuous forecasts. The proposed prediction method, Maximus, consists of two phases: modeling (also learning) and simulating (also predicting) the air temperature [28]. The purpose of the first phase is to find the optimal prediction model, while the purpose of the second phase is to test this prediction model in a real situation. In Figure 6, the Maximus model learning is presented, which is divided into more steps as follows: Extracting weather features from the RNWP model CERRA [16] is conducted first. Interestingly, the extracting is performed manually in the so-called generations, where different sets of available features in the CERRA dataset are selected for the LSTM input, in order to establish which features are more important for predicting the air temperature, and thus determines the topology of the LSTM network. Next, the optimization of LSTM hyper-parameters follows, where the optimal architecture of the NN is searched for. The result of this step is the prediction model that needs to be evaluated. In the evaluation step, the predicted time-series generated by the RNWP model ICON-D2 is constructed and serves as the reference prediction model. When the proposed predicted air temperature time-series is better than the reference one, according to the evaluation metrics discussed in the remainder of the paper, it is announced as the new best prediction model. Finally, at the end of the optimization, the last best prediction model is taken as a Maximus optimal prediction model. The input to the LSTM network in the proposed method is defined as a set of features from the CERRA dataset in the learning phase that are preprocessed to similar names of the features as found in the CERRA dataset. Obviously, the set of features can be set manually by the developer. Actually, the task of the LSTM network is to predict the future values of the air temperature from the sequences of the past data captured in the last \(T\) hours. Figure 5: Illustration of the process from data collection to model evaluation and using the best prediction model in practice. Obviously, the ICON-D2 dataset supports the similar names of the features as the CERRA that allow us to compare both time-series (i.e., reference and proposed) fairly. In general, the method \"Sliding Window\" (SW) is applied, where the future sequence of \(T\) feature's values are predicted from the past \(T\) feature's values, as follows:  
\[ \begin{array}{c}\begin{array}{c}Feat_{1}^{(t-T+1)},\ldots,Feat_{1}^{(t)}\\ \ldots\\ \underbrace{Feat_{N}^{(t-T+1)},\ldots,Feat_{N}^{(t)}}_{\text{Past}}\end{array} \Longrightarrow\underbrace{Feat_{1}^{(t+1)},\ldots,Feat_{1}^{(t+T)}}_{\text{ Future}},\end{array}  \tag{1}\]  
where there is a sequence of history data for features \(Feat_{i}^{(t)}\) for \(i=1,\ldots,N\) denotes the past values at time \(t\) that serve to predict the future values from the \(Feat_{1}^{(t+1)}\) to the \(Feat_{1}^{(t+T)}\), while the parameter \(N\) is the number of features and the parameter \(T\) the number of packets within the sequence.