# Greenhouse Temperature Prediction Based on Time-Series Features and LightGBM
## 5 Results and Analysis
### Analysis of Results
In summary, Table 4 shows that the prediction of each model was improved after adding time-series features, and the time-series features made the most obvious improvements to the prediction of LightGBM, with the MSE on the test set decreasing from 0.5868 to 0.4776 (i.e., by 18.61%). LightGBM performed better than the other models for all evaluation indicators. After adding the time-series features, the fitting degree of LightGBM was 98.05%. Comparing LightGBM with other models after adding time-series features, the MSE was lower by 11.70% (versus the SVM) and \(-\)29.12% (versus the RBF), the MAE was lower by 8.66% (versus the SVM) and \(-\)21.88% (versus the RBF), and the R2_score was improved by 0.26% (versus the SVM) and 0.80% (versus the RBF). LightGBM therefore performed better in prediction. We statistically analyzed the confidence interval of the absolute error between the predicted value and the real value of each model at the 95% confidence level, and the results are presented in Table 5. The table shows that for the same confidence level and the same sample size, the confidence interval of the absolute value error of the predicted value of the LightGBM model with time-series features was narrower than the intervals for other models, which shows that the estimated error for the LightGBM model was smaller and the prediction was more accurate than for the other models. The confidence intervals of the linear regression model and SVM model without time-series features were smaller than the interval for the time-series model. The results here coincide with the results presented in Table 4. After adding the features of the time series, BP neural network, and RBF neural network, the confidence interval decreased to a certain extent, but the effect was weaker than that for the LightGBM model. Figure 17 shows the variation in the training time for each model with the cross-validation folding number. A greater number of folds for cross-validation results in a longer time for training. Among the models, the training times of the BP neural network and MLP model had a negative increase with the change in fold number, owing to the early stopping mechanism used to prevent overfitting in the experimental process. This also shows the instability of using the BP neural network and MLP in cross-verification. Compared with the RBF model, SVM, and BP neural network, the LightGBM model required less training time and obtained better results in less time. The LightGBM model is thus superior to other models in terms of both prediction accuracy and time efficiency. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Model** & **0.95 Confidence Interval** & **Without Time-Series** & **With Time-Series** \\  & **Features** & **Features** \\ \hline LightGBM & [\(-\)0.5901, 1.6256] & [\(-\)0.5816, 1.4799] \\ \hline BP & [\(-\)0.6194, 1.7898] & [\(-\)0.5436, 1.6672] \\ \hline SVM & [\(-\)0.5422, 1.5645] & [\(-\)0.5815, 1.5650] \\ \hline Linear Regression & [\(-\)0.5624, 1.5601] & [\(-\)0.6204, 1.6266] \\ \hline RBF & [\(-\)0.6150, 1.7952] & [\(-\)0.5750, 1.7249] \\ \hline MLP & [\(-\)0.6586, 1.7045] & [\(-\)0.5801, 1.6085] \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Confidence interval of each model at the 95% confidence level. Figure 18 compares the training times for different models with the optimal hyperparameters before and after adding time-series features. The BP neural network and RBF model required less training time after adding time-series features because the early stopping mechanism ensures that the parameters of the model converge earlier. The time required by the SVM model obviously increased after adding the time-series features, which indicates that the SVM model is extremely sensitive to the feature dimension. Compared with the other models, LightGBM took a little more time than the linear regression and much less time than other models after adding time-series features. LightGBM thus rapidly provided prediction results. Figure 17: Training time versus the number of folds of different models.