# A Practical and Adaptive Approach to Predicting Indoor CO2
## 5 Simulation Setup  
Table 2 reports the values of the main parameters used in the simulations. \begin{table}
\begin{tabular}{c c} \hline \hline
**Parameter** & **Value** \\ \hline Environmental variables in input & Temperature, humidity, CO\({}_{2}\) \\ Time granularity of data & 15 min \\ Quarters of an hour in a sample & 8 \\ Number of kernel filters—Convolutional layer & 64 \\ Kernel size—Convolutional layer & 3 \\ Pool size—Max Pooling layer & 2 \\ Learning rate & 0.001 \\ Batch size & 32 \\ Optimizer & Adam \\ Loss function & Mean squared error \\ Validation split & 0.3 \\ Maximum number of epochs & 5000 \\ Patience & 25 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Simulation parameters. Figure 3: The sequence of operations at different quarters of an hour (t\({}_{0}\), t\({}_{1}\), \(\ldots\), t\({}_{95}\)) during a day. Temperature, humidity and CO\({}_{2}\) of the dataset were used as input variables to predict future CO\({}_{2}\) levels. They are the most relevant variables required to be monitored by managers to have an overview of IAQ. Additional cutting-edge sensors to monitor complex air pollutants, such as particulate matter (PM1, PM2.5 or PM10) or VOC, make the cost of a data collection system increase significantly. Moreover, these variables depend not only on human activity but also on other agents, which can be considered of minor interest in a scenario such as that of retail sites. As a result, we optimized the choice of the input variables, coherently with the rest of the proposed system. Their value ranges are reported in Table 3.  
In [10], the data were characterized by a time granularity equal to one minute. However, the original values of the dataset were aggregated every 15 min in order to simulate a typical data collection scenario. We evaluated the main hyper-parameters of the 1D CNN in order to find the values to guarantee a good trade-off between the accuracy of the model and its computational requirements. In this regard, we used root mean squared error (RMSE) as the performance metric:  
\[RMSE=\sqrt{\frac{1}{N}\sum_{i=1}^{N}(y_{i}-\hat{y_{i}})^{2}} \tag{1}\]  
where \(y_{i}\) is the real CO\({}_{2}\), \(\hat{y_{i}}\) is the predicted CO\({}_{2}\) and \(N\) is the total number of quarters of an hour. We evaluated the performance of the system by varying the number of quarters of an hour per sample. We experimented by considering other relevant parameters--such as pool size, kernel size and number of convolutional filters--and report the results in Figure 4:  
* **Pool size** is important to extract the most relevant information from the feature vectors provided by the convolutional layer. According to Figure 4, we set it equal to 2, as global max pooling impacted the accuracy significantly. * **Kernel size** has a central role in extracting valuable information along the time dimension. The simulation results reported in Figure 4 show similar performances between different kernel sizes. Thus, we set it equal to 3, which is one of the standard values for CNNs. * **Number of convolutional filters** was set to 64. Indeed, as reported in Figure 4, we noticed that higher values (e.g., 128 and 256) guaranteed similar performances, especially when samples included a few quarter-hour measurements. In this way, we provide more compact and lightweight models, reducing their memory footprints and guaranteeing faster computation, especially on limited-power and resource-constrained devices. \begin{table}
\begin{tabular}{c c} \hline \hline
**Parameter** & **Range** \\ \hline Temperature & 0–40 \({}^{\circ}\)C \\ Humidity & 0–80 \% \\ CO\({}_{2}\) & 350–5000 ppm \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Range of the input variables. Other parameters were:  
* **The learning rate** was set to 0.001, a value used in many complex and non-linear problems, which guarantees a good trade-off between convergence and computational time. * **The batch size** was set to 32 to guarantee stability, and to limit the memory footprints of the models.