## 1 Introduction
This study's preselected set of environmental factors includes the indoor population in a classroom and various other environmental considerations that may impact CO\({}_{2}\) concentrations. The factors included in the final set from among all of the environmental factors should be comprehensive and pivotal to effectively predict and control CO\({}_{2}\) concentrations in the classroom environment. To further enhance the predictive accuracy of the LSTM network model for identifying factors influencing classroom CO\({}_{2}\) concentrations and to address the challenge of hyperparameter selection, which often relies on empirical experience rather than a theoretical foundation in current LSTM models, this study introduces the random forest (RF) model [29]. The RF model was utilized to assess the significance of each environmental factor on the CO\({}_{2}\) concentration and subsequently rank them based on their importance. Based on the outcomes, the input variables for the LSTM model were meticulously chosen, encompassing the most pertinent influencing factors. Furthermore, the tree-structured Parzen estimator (TPE) algorithm [30] was introduced to enhance the selection of crucial hyperparameters for the LSTM model, culminating in the development of the RF-TPE-LSTM model for CO\({}_{2}\) concentration prediction. In the final stage of experimentation, the RF-TPE-LSTM model was compared with the RF-LSTM model, and the prediction accuracy of the RF-TPE-LSTM model was evaluated using performance metrics such as the coefficient of determination (\(R^{2}\)) [31], mean absolute error (_MAE_) [32], root mean square error (_RMSE_) [33], and mean absolute percentage error (_MAPE_) [34]. The experimental results clearly demonstrated that the selection of influencing factors had a certain impact on the CO\({}_{2}\) concentration prediction model, and there are also different prediction effects for different prediction times. The optimized model outperformed the unoptimized model, demonstrating significant advantages in terms of predictive accuracy. The \(R^{2}\) value achieved by the RF-LSTM model was greater than 95%, while that of the RF-TPE-LSTM model significantly surpassed this value, achieving an \(R^{2}\) exceeding 98%. Moreover, the RF-TPE-LSTM model not only demonstrated better fitting and superior prediction accuracy compared to the RF-LSTM model but also outperformed the unoptimized LSTM model and other models. Hence, the CO\({}_{2}\) prediction model developed in this study proves to be highly effective at forecasting the concentration of CO\({}_{2}\) in indoor environments for future periods. This model provides a dynamic foundation for regulating classroom ventilation rates, thereby helping to create a healthy and productive learning environment for students. The remainder of this paper is structured as follows: Section 2 describes the dataset used in this study, along with the constructed model. Section 3 discusses data processing and presents the results of the comparison of different prediction times, hypermeters, and models. Finally, in Section 4, a summary and future directions for predicting indoor CO\({}_{2}\) concentrations are provided.