## 3 Results
### Co\({}_{2}\) Concentration Prediction Performance Evaluation  
After analyzing the importance of the environmental factors in this study, we identified the influencing factors affecting the CO\({}_{2}\) concentration in classrooms and thus used the results of the RF algorithm as the input variables to the LSTM to construct the RF-LSTM model. These variables include the temperature, humidity, illuminance, O\({}_{2}\) concentration, PM\({}_{2.5}\) concentration, PM\({}_{10}\) concentration, indoor population, and past CO\({}_{2}\) concentration. The model's output variable was set as the CO\({}_{2}\) concentration. We utilized 80% of the preprocessed final influencing factor dataset as the training set for neural network training and used the remaining 20% as the test set to assess the model accuracy [45]. As depicted in Figure 10, when the number of iterations ranged between 80 and 100, the loss function (MSE) nearly reached its minimum value, converging to approximately 0.0005. This finding suggests that the model exhibits strong convergence. Figure 11(a1) presents the fit of the RF-LSTM model for predictions on the training set data. Subsequently, the trained and converged RF-LSTM model was used to make predictions on the test set, and the results are presented in Figure 11(b1). As shown in Figure 11(a1,b1), on the test set, the predicted values vary only slightly from the true values, and the fit is good. However, further optimization is required for the extreme values output by the RF-LSTM model for the training set and for the fitting effect in the latter part of the test set. After multiple adjustments and optimizations of the RF-TPE-LSTM model using Hyperopt, the optimal combination of hyperparameters was determined as follows: number of LSTM units = 42, learning rate = 0.003996, number of epochs = 111, batch size = 110, and dropout rate = 0.133. Figure 11(a2,b2) show the visualization results obtained from the adjusted parameter combinations for the training and test sets, which reveal that the predicted values of the RF-TPE-LSTM model exhibit a better fit with the true values at multiple extreme points. Furthermore, the prediction accuracy does not significantly decrease in the later stages compared to that of the RF-LSTM prediction model. Since the fitting effect is subjectively determined only by the prediction effect graph, we evaluated the prediction models for the CO\({}_{2}\) concentration in classrooms based on time series analysis using the four evaluation metrics mentioned earlier: _MAE_, _RMSE_, _MAPE_, and \(R^{2}\). \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Number of Features** & _RMSE_ & _MAE_ & _MAPE_ & \(R^{2}\) \\ \hline Top six features & 21.70 & 18.38 & 3.96\% & 90.68\% \\ Top seven features & 14.17 & 7.21 & 1.45\% & 93.31\% \\ Top eight features & 15.66 & 9.87 & 2.05\% & 93.34\% \\ All features & 15.49 & 10.59 & 2.22\% & 93.38\% \\ \hline \hline \end{tabular}
\end{table} 
Table 5: LSTM performance evaluation based on different numbers of features. To explore the prediction performance of the RF-TPE-LSTM model with respect to the prediction time, we used historical 60 min data to predict the classroom CO\({}_{2}\) concentration at multiple future time points--10, 20, 30, 40, and 50 min--with each minute representing a step. The overall evaluation of the prediction performance is shown in Figure 12, which shows that as the prediction time increases, the errors of the three evaluation indices increase to different degrees, and the \(R^{2}\) goodness of fit gradually decreases. When predicting the classroom CO\({}_{2}\) concentration in the next 10 min, the lowest \(MAE\), \(RMSE\), and \(MAPE\) values are 2.96, 5.54, and 0.60%, respectively, and it has the best fit, with a value of 98.02% for \(R^{2}\). When predicting the classroom CO\({}_{2}\) concentration for the next 30 min, the \(MAE\), \(RMSE\), and \(MAPE\) values increased to 10.02, 20.76, and 2.05%, respectively, while the \(R^{2}\) decreased to 85.65%.