## 3 Materials and Methods
### Feature Engineering  
Feature engineering plays a vital role in developing ML models and data analysis. Its main objective is to enhance the models' performance and efficiency by selecting, transforming, and creating significant features from the initial data. This crucial process can significantly impact the accuracy and efficiency of the ML algorithms [46].  
For data pre-processing, the first step was to detect and delete the null values within the data sequence, where data of the climatic variables of interest were found and did not let the proposed algorithms apply due to not having a valid or consistent value. Secondly, the null data were replaced by using linear interpolation techniques, and the database was grouped into seasons of the year (3 months per interval) because it benefits in preventing underfitting during model training. Finally, they were divided into training and validation data of the LSTM-RNN model.  
The database analysis determined that each season has distinct patterns and varying quantities of samples, as shown in Figure 1. Research by [PERSON] et al. [22] has indicated that dividing the database into annual seasons is helpful to prevent underfitting. This is due to the varying temperature trends observed throughout the year. After considering this information, it was decided to proceed with prediction models that use the seasonal division of data.  
Striking a balance between incorporating informative variables and avoiding unrelated ones is important. Incorporating informative variables can enhance the output, while unrelated ones can introduce unnecessary noise to the model. Therefore, the database variables were analyzed to identify significant correlations and determine which variables should be used in the models to ensure accurate predictions.  
\begin{table}
\begin{tabular}{c c c} \hline
**Variable Nomenclature** & **Description** & **Unit of Measurement** \\ \hline Ti & Internal temperature & \({}^{\circ}\)C \\ To & External temperature & \({}^{\circ}\)C \\ Ho & External humidity & \% \\ Hi & Internal humidity & \% \\ Di & Internal dew point & \% \\ Rs & Solar radiation & W/m\({}^{2}\) \\ \hline \end{tabular} \({}^{\circ}\)C = Degrees Celsius, \% = Percentage, W/m\({}^{2}\) = Watts per square meter.  
\end{table}
Table 1: Greenhouse data set variables.  
The correlational analysis can be seen in Figure 2, where each variable is shown concerning each year's season. This enabled us to identify the following key points:  
* Relative humidity decreases as the internal temperature increases;
* Internal temperature increases as the solar radiation increases;
* The dew point increases as the relative humidity increases;
* The internal temperature is affected by the external temperature.  
Figure 1: Dataset corresponding to greenhouse internal temperature. Data for fall (**a**), summer (**b**), spring (**c**), and winter (**d**).  
Figure 2: Correlation maps for each year’s season. Fall (**a**), summer (**b**), spring (**c**), and winter (**d**).  
In order to create a prediction model for the internal temperature of a greenhouse, this research focuses on the following independent variables: To, Ho, Hi, Di, and Rs, whereas Ti is the dependent variable. The correlation maps show positive correlations between two or three variables; thus, for a sequence of three input elements and one output element, the many-to-one configuration can be used to perform an analysis. By analyzing these variable combinations, irrelevant or redundant features can be eliminated and reduce the risk of overfitting, leading to a better-performing model.  
Equation (1) provides the possible combinations for arranging three input elements based on independent variables:  
\[{}^{n}C_{r}=n!\frac{n-r}{!}r! \tag{1}\]  
where \(n\) represents the independent variables, and \(r\) represents the input variables considered for the model. Table 2 displays the ten combinations used for testing the models in many-to-one analysis.