# Field Data Forecasting Using LSTM and Bi-LSTM Approaches
## 2 Materials and Methods
### Modeling and Pattern Selection
#### 2.3.2 Hyperparameters Selection  
Following our preliminary tests, we concluded that a good selection of hyperparameters is related to the model's performance. In order to achieve the best results in terms of prediction accuracy and error value, we went through an extensive model hyperparameters tuning step for our model. According to our tests, the most significant hyperparameters are the model Learning Rate (LR) while training, a split ratio of training and testing data, \begin{table}
\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|} \hline  & **Indoor** & **Indoor** & **Indoor** & **Indoor** & **Outdoor** & **Outdoor** & **Outdoor** & **Outdoor** & **Soil** & **cos\_Times** & **sin\_Times** \\  & **Temp** & **Humid** & **UV** & **lux** & **CO\({}_{2}\)** & **Temp** & **Humid** & **UV** & **Solar** & **Moisture** & **cos\_Times** & **sin\_Times** \\ \hline
0 & 28.11 & 37.81 & 0.36 & 63 & 599.0 & 31.39 & 36 & 0 & 0.0 & 63.1 & \(-\)0.7223871 & 0.689935 \\ \hline
1 & 27.92 & 37.56 & 0.36 & 70 & 599.0 & 31.39 & 36 & 0 & 0.0 & 62.2 & \(-\)0.727573 & 0.686030 \\ \hline
2 & 27.30 & 35.38 & 0.36 & 10230 & 599.0 & 31.28 & 36 & 0 & 0.0 & 62.7 & \(-\)0.742414 & 0.669941 \\ \hline
3 & 28.38 & 70.19 & 0.07 & 1000 & 475.0 & 31.28 & 36 & 0 & 0.0 & 62.6 & \(-\)0.7639984 & 0.645233 \\ \hline
4 & 32.81 & 55.13 & 1.87 & 35140 & 475.0 & 31.22 & 36 & 0 & 0.0 & 62.2 & \(-\)0.777878 & 0.628416 \\ \hline \end{tabular}
\end{table} 
Table 4: Sample of the processed data. \begin{table}
\begin{tabular}{|l|c|c|c|c|c|c|c|c|c|c|} \hline
**Variable** & **Mean** & **Standard Error** & **Median** & \begin{tabular}{c} **Standard** \\ **Deviation** \\ \end{tabular} & \begin{tabular}{c} **Variance** \\ \end{tabular} & \begin{tabular}{c} **Minimum** \\ \end{tabular} & \begin{tabular}{c} **Maximum** \\ \end{tabular} & \
\begin{tabular}{c} **Valid** \\ \end{tabular} &
\begin{tabular}{c} **Missing** \\ \end{tabular} \\ \hline Date & 4407/0.5313 & 0.140055674 & 44017 & 18.73890461 & 351.146546 & 43985 & 44049 & 17749 & 0 \\ \hline Time & 0.495631904 & 0.02184724 & 0.494050926 & 0.29100621 & 0.0847616285 & 4.638-0.05 & 0.999990356 & 17249 & 0 \\ \hline Indoor temp & 29.83309539 & 0.03779975 & 27.93 & 5.035868181 & 25.46013862 & 23.27 & 47.41 & 17249 & 0 \\ \hline Indoor humid & 75.64751197 & 0.14488623 & 79.96 & 19.29787169 & 372.4001327 & 25.64 & 100 & 17249 & 0 \\ \hline Indoor UV & 0.905852822 & 0.09051766 & 0.08 & 1.446309769 & 22.1428039 & 0 & 7.72 & 17249 & 0 \\ \hline Indoor lux & 11568/96558 & 130.40466991 & 933 & 17373.21068 & 301828449.3 & 0 & 54612 & 17749 & 0 \\ \hline CO\({}_{2}\) indoor & 533.2625409 & 0.384002603 & 536 & 51.14880801 & 2616.199824 & 309 & 715 & 17749 & 0 \\ \hline Outdoor temp & 27.80067384 & 0.01631451 & 27.39 & 2.17960373 & 4.751355382 & 23.89 & 39.22 & 17742 & 7 \\ \hline Outdoor humid & 50.48223562 & 0.114157858 & 47 & 15.20872326 & 231.3058361 & 33 & 99 & 17749 & 0 \\ \hline Outdoor wind & 0.011347118 & 0.000578974 & 0 & 0.077134085 & 0.005948627 & 0 & 1.4 & 17749 & 0 \\ \hline Outdoor wind & 0.029722407 & 0.001031529 & 0 & 0.137425796 & 0.0188986849 & 0 & 2.4 & 17749 & 0 \\ \hline Outdoor Pressure & & & & & & & & & & & \\ \hline Outdoor Prejo. Rate & 0.0057068 & 0.0006663134 & 0 & 0.088612771 & 0.00785223 & 0 & 3.78 & 17749 & 0 \\ \hline Outdoor Prejo. Accum & & & & & & & & & & & \\ \hline Outdoor UV & 0.044142205 & 0.002202212 & 0 & 0.29390479 & 0.08607793 & 0 & 2.7 & 17749 & 0 \\ \hline Outdoor UV & 0.085356922 & 0.004644671 & 0 & 0.618788005 & 0.3828986895 & 0 & 10 & 17249 & 0 \\ \hline Outdoor Solar & 11.27086596 & 0.527580327 & 0 & 70.28415491 & 4939.864231 & 0 & 1102.3 & 17749 & 0 \\ \hline Soil moisture & 56.21100907 & 0.02031385 & 56.1 & 2.688672806 & 7.22986038 & 50.7 & 87.9 & 17749 & 0 \\ \hline \end{tabular}
\end{table} 
Table 3: Descriptive statistics for the dataset. batch size of training and testing data, time steps, and the validation model's time interval. Table 5 reports the values of the best hyperparameters based on our empirical study.