# Greenhouse Temperature Prediction Based on Time-Series Features and LightGBM
## 5 Results and Analysis
### Analysis of Results  
We used the Python language for programming and extracted the difference features, statistical features, and cross-features mentioned above. The LightGBM model, BP neural network, SVM, linear regression model, RBF neural network, and multiple linear regression (MLPRegressor, MLP) were used for training and prediction. The dataset was split 1- to 10-fold to validate the selection of the best hyperparameters and retrain all the models. The fitting results of the models are shown in Figures 5-16. The green line shows real values of the test set data, and the red and blue lines show the prediction results of each model on the test set. The figures show that each model performed well in terms of the degree of fitting, and the fitting result of LightGBM was better than the fitting results of the other five models, being closer to the trend line of the actual value. Since the temperature in the greenhouse has a strong time sequence (i.e., without the effects of special factors), the greenhouse temperature at this time strongly correlated with the greenhouse temperature at the previous time. The fitting of the predicted value to the actual value in the early stage was better than that in the later stage. The value on the horizontal axis is the number of hours after 1:00 on 3 April 2019. Figure 5: Fitting trend of the prediction results of LightGBM. Figure 8: Absolute error of the BP neural network with and without the time-series features. Figure 6: Absolute error when using LightGBM with and without the time-series features. Figure 7: Fitting trend of the prediction results of the BP neural network. Figure 11: Fitting trend of the prediction results of linear regression. Figure 10: Absolute error of the SVM with and without the time-series features. Figure 9: Fitting trend of prediction results of the SVM. Figure 14: Absolute error of the RBF neural network with and without the time-series features. Figure 12: Absolute error of the linear regression with and without the time-series features. Figure 13: Fitting trend of the prediction results of the RBF neural network. In Figure 5, the green line is the change curve of the real value, the blue line is the change curve of the prediction result of LightGBM using the original features, and the red line is the change curve of the prediction result of LightGBM after adding the time-series features. It is seen that when the temperature smoothly changed, the prediction results were close to the real value both before and after adding the time-series features. When the temperature sharply changed, the prediction result was closer to the curve of the real data after adding the time-series features. The situation was similar at other positions where the temperature suddenly changed on the curve, such as approximately 160 and 183 h.  
In Figure 6, the blue line is the absolute error of the prediction results without time-series features, and the red line is the absolute error of the prediction results after adding time-series features. It is seen that in the early prediction results, the results obtained using only the original features and those also using the time-series features were close, but after approximately 52 h, the absolute error when using only the original features gradually became greater than that when also using the time-series features.