## Modeling and Analyzing the Energy Efficiency Using the Proposed Approach  
### Clustering Data  
Each home has different characteristics and energy consumption. Categorizing data based on the author's opinion and the distribution of features is not very appropriate because it involves the author's assumptions and speculation. In this type of category, the probability of error and inaccuracy increases, which is contrary to the purpose of the article, to achieve results with greater accuracy. Cluster analysis is an unsupervised learning technique which finds data that has the most similarity with each other, and also the greatest difference with other data, and places them in a group called a cluster.  
Clustering algorithms have a wide range that can be named partitioning, hierarchical, density-based, and grid-based methods. The residential buildings of this article are clustered using the k-means algorithm. This algorithm is used for clustering in different data sets [49] and also in energy consumptions field for different datasets [50; 51; 52]. Among different indicators for estimating the optimal number of clusters [53; 54], the silhouette index [55] has been selected to calculate with a different number of clusters. The silhouette has a range of \(-1\) to \(1\), where \(1\) indicates the best matched and \(-1\) indicates variables which are poorly matched to their cluster.  
Table 3 shows the Silhouette index values of clustering data of this article. While this indicator is an important factor for clustering, it should be noted that in the real world and information retrieval, clusters must have a comprehensible interpretation (cluster labeling). So, the selection of the best number of clusters should be based on a combination of the index and the labeling. The silhouette value of 2 and 3 clusters is greater than others (Table 3), which means that these clusters have a better coherence, although these values are close together. Therefore, the appropriate value is that which has a better interpretation and labeling adequate to the cluster's data attributes. Regarding the values of variables, in either case, three clusters have more interpretation and make a better differentiation within and between clusters. Hence, it was selected as the best number of clusters.  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Number of Clusters** & **Silhouette Index Value** \\ \hline
2 & 0.243 \\
3 & 0.239 \\
4 & 0.189 \\
5 & 0.195 \\
6 & 0.155 \\
7 & 0.155 \\
8 & 0.166 \\
9 & 0.158 \\
10 & 0.179 \\ \hline \hline \end{tabular}
\end{table}
Table 3: Silhouette index values.  
The three-clusters clustering results are as follows. Figure 3 indicates the size of these clusters. According to these characteristics and the average annual energy consumption of each cluster, cluster 1, cluster 2 and cluster 3 are labeled as medium-consumption, high-consumption and low-consumption clusters.  
* Cluster 1: This cluster's homes are old (almost 68% built before 1930). Most of the households have a D label in the energy efficiency group and half of them have houses with an area of 51 m\({}^{2}\) to 100 m\({}^{2}\).
* Cluster 2: 27.5% of the homes were built between 1968 and 1982. Most of the households have a D label in the energy efficiency group and 58.6% of them have houses with an area of 51 m\({}^{2}\) to 100 m\({}^{2}\). The households of this cluster have more energy consumption than those of the other clusters.
* Cluster 3: Most of the households have a C label in the energy efficiency group. The cluster homes are small (59% of homes have an area less than 51 m\({}^{2}\)). In comparison to other clusters, this cluster contains more newly-built houses and these also have the lowest energy consumption.