## 3 Result and Discussion
### Modeling of Behavior in Mechanical Ventilation Operation
#### 3.2.3 Predictive Modeling  
For the five clusters, the household dataset of each cluster is merged for next prediction modeling. The amount, imbalance rate and baseline accuracy of these datasets are listed in Table 6. In this study, logistic regression and random forest are used for modeling and comparison. The selected variables were used as input features of the models and min-max normalized, which are defined in Equation (8). The hyperparameters of random forest are default values. The logistic regression estimates coefficients of the five clusters are listed in Table 7:  
\[m=\frac{x-x_{min}}{x_{max}-x_{min}} \tag{8}\]  
where \(m\) is the transformed value, \(x\) is the original value, \(x_{min}\) is the minimum value in the variable column and \(x_{max}\) is the maximum value in the variable column.  
Pipeline is a tool in machine learning. It chains multiple estimators into one and is very convenient. In this paper, pipeline was developed, which combined dataset division, classification algorithms and model evaluation [35]. Using the pipeline, it can avoid data leakage, such as disclosing some testing data in training data, and result in more accurate assessment of the generalization ability of the models.  
The fitting results of logistic regression and random forest on training datasets are shown in Table 8. Moreover, the evaluation on the predictions by logistic regression and random forest models using the test dataset are provided in Tables 9 and 10, respectively. It is clearly that the accuracy of the non-clustered models is lower than those of the clustered models, supporting the fact that cluster analysis is necessary before mega-data modeling. It is notable that the higher the imbalance rate of a dataset, the worse the result of the logistic regression model, i.e., the imbalance rate of Cluster 5 is as high as 69.9%, and its ACC value of 0.698 just reached the baseline ACC value (0.692). Meanwhile, the evaluation indicators all show that the performances of random forest both on the training and test dataset are significantly better than logistic regression, and the performance is also very stable even if the dataset is very imbalanced, similarly to Cluster 5.  
\begin{table}
\begin{tabular}{c c c c c c c} \hline  & **Cluster 1** & **Cluster 2** & **Cluster 3** & **Cluster 4** & **Cluster 5** & **Non-Clustered** \\ \hline Turned off \(`0\lx@math@degree\) & 313,539 & 650,844 & 727,724 & 189,814 & 1,464,552 & 3,346,473 \\ Turned on \(`1\lx@math@degree\) & 198,744 & 400,476 & 466,301 & 164,897 & 259,305 & 1,489,723 \\ Imbalance rate & 22.4\% & 23.8\% & 21.9\% & 7.0\% & 69.9\% & 38.4\% \\ Baseline accuracy & 0.612 & 0.619 & 0.609 & 0.535 & 0.85 & 0.692 \\ \hline \end{tabular}
\end{table}
Table 6: The amount, imbalance rate and baseline accuracy of datasets.  
\begin{table}
\begin{tabular}{c c c c c c c c c c c c} \hline
**Cluster** & **CO\_In** & **PM\_2.5\_In** & **T\_In** & **PM\_2.5\_Out** & **T\_Out** & **RH\_Out** & **H** & **M** & **Spring** & **Summer** & **Autumn** & **Winter** \\ \hline
1 & - & - & 0.0081 & 0.1323 & \(-\)0.0489 & 0.0046 & \(-\)0.0046 & \(-\)0.2086 & \(-\)0.9559 & \(-\)3.0263 & \(-\)2.6139 & \(-\)6.464 \\
2 & - & - & - & \(-\)0.0563  
The predictive accuracy of the mechanical ventilation operation behavior models developed by random forest algorithm in this study is as high as 0.992 on average, which is higher than other occupant behavior models [23; 25; 36; 37]. This may be attributed to the larger data volume and the smaller sampling interval. In addition, clustering the households before modeling should have also improved prediction accuracies.