## 4 Case Study
### Application of the Benchmark Algorithms to Case Study  
In our research, the Calinski-Harabasz (\(CH\)) and Davies-Bouldin (\(DB\)) indices were employed as validation measures to determine the optimal number of clusters (\(K\)) through the \(K\)-means and SC algorithms.  
The \(CH\) index estimates cluster validity by calculating the ratio of the between- and within-cluster variances. This index is defined as follows [36]:  
\[CH=\frac{n-K}{K-1}\cdot\frac{SSB}{SSW} \tag{5}\]  
where \(n\) is the total number of time series and \(K\) is the number of clusters chosen in the classification. \(SSB\) and \(SSW\) represent inter- and intracluster dispersions, respectively. A greater \(CH\) index indicates better clustering results.  
The \(DB\) index, developed by [37], is calculated using the mean distance between the cluster elements and their respective centroids, denoted by \(\overline{d}_{k}\), and the distance between centroids, denoted by \(d_{k,k^{\prime}}\). The \(DB\) index is expressed mathematically by the following equation, where \(K\) represents the number of clusters, and it is desirable to minimize the \(DB\) parameter according to both compactness and separation criteria.  
\[DB=\frac{1}{K}\sum_{k=1}^{K}\max_{k^{\prime}\
eq k}\frac{(\overline{d}_{k}+ \overline{d}_{k^{\prime}})}{d_{k,k^{\prime}}}. \tag{6}\]  
The values of the \(CH\) and \(DB\) indices for the \(K\)-means algorithm in this case study are presented in Table 1. Based on the values in Table 1, it can be concluded that the optimal number of clusters \(K\) that produces the maximum value of the \(CH\) index and the minimum value of the \(DB\) index is equal to \(K=2\). A visual illustration of the centroids for the two clusters obtained through the \(K\)-means algorithm with \(K=2\) is shown in Figure 4.  
Based on the results presented in Figure 4, it can be deduced that the implementation of the \(K\)-means algorithm in the reference case study for data mining of the energy-consumption time series is flawed in its ability to produce effective clustering. The algorithm appeared to be capable of distinguishing only between high- and low-energy load profiles. Although the \(K\)-means algorithm is commendable for its simplicity, speed, and capacity to provide quick results, its suitability for clustering time-series data may be limited because of the nonspherical and heterogeneous nature of the energy consumption clusters in the present case study.  
The values of the \(CH\) and \(DB\) indices for the SC algorithm in this case study are listed in Table 2. Based on the values in Table 2, it can be concluded that the optimal number of clusters \(K\) that produces the maximum value of the \(CH\) index and minimum value of the \(DB\) index is equal to \(K=3\). A graphical representation of the centroids for the three clusters generated through the implementation of the SC algorithm with \(K=3\) is presented in Figure 5.  
\begin{table}
\begin{tabular}{c c c} \hline \  
Based on the findings presented in Figure 5, it can be concluded that the implementation of the SC algorithm in the reference case study for energy consumption data mining cannot form effective clusters. Nevertheless, the SC algorithm is capable of recognizing diverse patterns of energy consumption and provides more insight than the \(K\)-means algorithm.