## 6 Conclusions  
The focus of this research was to predict the internal temperature of a greenhouse up to an hour in advance. Supervised learning algorithms, such as LSTM-RNN and XGBoost, were utilized to generate models capable of establishing preventive control of greenhouse conditions. The database used in this research included internal variables such as temperature, humidity, and dew point, as well as external variables such as temperature, humidity, and solar radiation. This paper generated a methodology for constructing models to which machine learning was applied. Based on the LSTM-RNN and XGBoost algorithms, the best combination of input variables (internal humidity, internal \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Work** & **Model** & **R\({}^{2}\)** & **MAE** & **MAPE** & **RMSE** & **Advanced Prediction** \\ \hline [PERSON] et al. [25] & ANN & 0.98 & 0.558 & - & 0.7 & 24 h \\ [PERSON] et al. [26] & BP-RNN & 0.953 & 0.421 & - & 0.751 & N/A \\ [PERSON] et al. [28] & ANN & 0.96 & - & 0.491 & 1.5 & N/A \\ [PERSON] et al. [34] & CNN-LSTM & - & 2.573 & 5.316 & 3.864 & 5–60 min \\ [PERSON] et al. [37] & LSTM-RNN & 0.84 & - & - & 0.764 & 30 min \\ [PERSON] et al. [22] & SVM & 0.9998 & 0.0422 & 0.0015 & 0.0549 & N/A \\ [PERSON] et al. & LSTM-RNN & 0.9994 & 0.1449 & 0.0041 & 0.2698 & 1 h \\ \hline \hline \end{tabular}
\end{table} 
Table 11: Comparison of studies presented in related works. -dew point, and solar radiation--Hi-Di-Rs) was found concerning the output variable (internal temperature--Ti). Bayesian optimization was used in each of the algorithms to analyze the best hyperparameters and apply them to the models. This model's construction led to eight experiments focused on the two algorithms and each year's season. The results were evaluated using the R\({}^{2}\), RMSE, MAE, and MAPE metrics, which showed that LSTM-RNN presented better performance than XGBoost in all seasons. LSTM-RNN had the best result in the summer season with an R\({}^{2}\) value of 0.9994, while XGBoost had the lowest result in the summer season with an R\({}^{2}\) value of 0.8605. Based on the prediction results of the LSTM-RNN and XGBoost algorithms, it is possible to develop a system that can accurately anticipate the internal conditions of a greenhouse up to an hour in advance. These models enable the control system to make proactive decisions and provide instructions to the various actuators in the greenhouse. However, several challenges impact the models' accuracy and the required computational resources when implementing predictive models based on these algorithms. Two fundamental limitations can be mentioned in particular. Firstly, as the forecasting capacity of the model increases, there is a corresponding increase in computational cost. Secondly, prediction errors such as RMSE and MAE tend to increase when projecting towards extended periods. Therefore, it is essential to balance the model's predictive capacity and the available computational resources to ensure optimal performance. Conceptualization, L.F.L.-V., M.A.C.-M. and R.C.-N.; methodology, R.C.-N. and M.A.C.-M.; software, J.M.E.-G., M.E.M.-R. and C.A.O.-O. ; validation, H.A.G.-O., L.F.L.-V., M.A.C.-M. and F.G.-V.; formal analysis, J.M.E.-G., F.G.-V. and M.E.M.-R.; investigation, J.M.E.-G., H.A.G.-O. and L.O.S.-S.; resources, M.A.C.-M. and R.C.-N.; data curation, J.M.E.-G.; writing--original draft preparation, J.M.E.-G. and L.F.L.-V.; writing--review and editing, L.F.L.-V., F.G.-V. and H.A.G.-O. ; visualization, J.M.E.-G., C.A.O.-O. and H.A.G.-O. ; supervision, L.F.L.-V., M.A.C.-M. and R.C.-N.; project administration, H.A.G.-O. and F.G.-V.; funding acquisition, M.A.C.-M., L.O.S.-S. and R.C.-N. All authors have read and agreed to the published version of the manuscript. This research received no external funding. Not applicable. **Data Availability Statement:** Publicly available datasets were analyzed in this study.