## 6 Selection of Important Parameters in the Clustering Algorithm  
In the process of identification and separation by the KNN method, the selection of some parameters is critical for accuracy, primarily the selection of clustering samples and the number of clusters, \(K\). As for the number of clusters, \(K\), it should be selected according to actual demand. When one needs to identify and separate abnormal data by the KNN method for daily data, the three states, that is, closed, slightly open, or fully open, should be considered. When one needs to identify and separate abnormal data for daily data, it is enough to divide into two states, that is, closed and open. Regarding the selection of clustering samples, the number of clustering samples, such as samples in a whole year or in a cooling season, directly affects the clustering results. In severely cold and cold climate areas, outdoor temperature values vary greatly in different seasons. Thus, in the case of clustering with outdoor temperature and power consumption values as variables, the outdoor temperature values vary with the number of clustering samples, which means that there is a difference between the identification and separation results. To obtain the best size of samples with strong applicability and more accuracy, the sample in a whole year, a cooling season, or a \"transition season + cooling season\" are selected for validation. Samples for a whole year of Building A are selected for identifying and separating using the k-means clustering algorithm. The detailed information for these samples is shown in Table 8.  
According to the data in Table 7, the following problems are noted. First, the variation trend of power consumption and the outdoor temperature are different, which means that identifying the three states (closed, slightly open, fully open) is difficult. Second, it is difficult to guarantee the eligible identification accuracy. If the power consumption value is used to define the three states of air-conditioning, the accuracy of identification results is 73.25%. If the outdoor temperature value is used to define the three states of air-conditioning, the accuracy of identification results is 22.42%. Finally, the outdoor temperature threshold difference of each cluster is too large, which means that identifying the state of air-conditioning is difficult. \begin{table}
\begin{tabular}{c c c c} \hline \hline  & **Technical Code in** & **IPMVP** & **FEMP** \\  & **China (JGJ176-2009)** & & \\ \hline Error in one month & \(\pm\)15\% & \(\pm\)20\% & \(\pm\)15\% \\ Error in one year & No Standard & No Standard & \(\pm\)10\% \\ \hline \hline \end{tabular} Note: Technical code in China (JGJ176-2009) is “Technical code for the retrofitting of public building on energy efficiency”; IPMVP is “International Performance Measurement and Verification Protocol”; and FEMP is “US Federal Energy Management Program”.  
\end{table} 
Table 7: Relevant international regulations. Similarly, samples of the cooling season (from June to August) for Building A, and samples of the \"transition season + cooling season\" (from April to August) for Building A are also selected. The different results of identification are shown in Figure 18, with the detailed data shown in Tables 3 and 9 separately. It is seen that the identification results of air-conditioning with the data of \"cooling season + transition season\" is the closest to the actual conditions, followed by the results of the cooling season.