## 3 Materials and Methods
### Model Evaluation  
Evaluating a model is essential in developing any ML algorithm; therefore, this paper proposes using four metrics to measure and analyze the model's performance on the LSTM-RNN and XGBoost algorithms to determine its suitability for predicting internal temperature in the greenhouse.  
The proposed metrics are as follows: R\({}^{2}\) (Equation (18)), RMSE (Equation (19)), MAE (Equation (20)), and MAPE (Equation (21)).  
\[R^{2}=1-\frac{RSS}{TSS}=1-\frac{\sum(y_{i}-\hat{y}_{1})^{2}}{\sum(y_{i}-\overline {y}_{1})^{2}} \tag{18}\]  
\[RMSE=\sqrt{\frac{1}{n}\sum_{i=1}^{n}(y_{i}-\hat{y}_{1})^{2}} \tag{19}\]  
\[MAE=\frac{1}{n}\sum_{i=1}^{n}\mid y_{i}-\hat{y}_{1}\mid \tag{20}\]  
\[MAPE=\frac{1}{n}\sum_{i=1}^{n}\frac{\mid y_{i}-\hat{y}_{1}\mid}{y_{i}} \tag{21}\]  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Parameter** & **Description** \\ \hline Learning rate & Determines the shrinkage step size. \\ Max leaves & Sets the limit on the number of nodes to be added. \\ Max depth & Determines the maximum levels each tree \\  & can have. \\ Min child weight & Sets the minimum weight required for \\  & instances in a leaf. \\ Gamma & Sets the minimum loss reduction needed for \\  & further partitioning. \\ Subsample & Represents the ratio of features/columns used \\  & for fitting each tree. \\ Column sample by tree & Determines the ratio of features/columns used \\  & for fitting each tree. \\ \hline \hline \end{tabular}
\end{table}
Table 4: Hyperparameters for an XGBoost model.  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Parameter** & **Description** \\ \hline Number of units & Number of LSTM memory cells used to store \\  & temporal information. \\ Number of hidden layers & Number of layers of LSTM units in \\  & the network. \\ Number of epochs & Determines how often the machine learning \\  & algorithm cycles through the training data set. \\  & Number of samples used per gradient update: \\  & a larger batch size can speed up the training \\  & process but requires more memory. \\  & Represents the size of the steps taken by the \\ Learning rate & algorithm to fit the model weights \\  & during training. \\  & Method used to update weights \\ Optimizer & during training. \\ Activation function & Type of nonlinear activation function. \\ Regularization & Technique used to prevent overfitting by \\  & eliminating neurons in the LSTM layers. \\ \hline \hline \end{tabular}
\end{table}
Table 3: Hyperparameters for an LSTM model.  
where \(y_{i}\) represents the actual value observed, \(\hat{y}_{1}\) is the value predicted by the model, and \(n\) is the total number of observations in the data set.  
R\({}^{2}\) measures how much the independent variables affect the dependent variable in terms of variance proportion. It uses the Residual Sum of Squares (RSS) and Total Sum of Squares (TSS). The RMSE is derived from the Mean Square Error (MSE) to standardize their units of measurement. The MSE measures variance by how well a model fits the training data. The RMSE is helpful because it gives more importance to specific data points, significantly impacting overall error if a prediction is incorrect. MAE evaluates the distance between the regressor and real points. The MAE does not heavily penalize outliers due to its norm that smooths out all errors, which provides a generic and bounded performance measure for the model. MAPE is used when variations impact the estimate more than the absolute values. However, this metric is biased toward low forecasts and is therefore unsuitable for evaluating tasks where errors of significant magnitude are expected [56; 57].