# \(K\)-Means Cloning: Adaptive Spherical \(K\)-Means Clustering
## 3 KMC Algorithm  
In this section, we outline the KMC algorithm. We show how the algorithm exploits the aforementioned cluster number determination, splitting, and merging procedures to perform \(K\)-means evolving cloning. The details of the proposed method is given in Algorithm 2. Moreover, a general layout of the algorithm is shown in Figure 6.  
```
1:Clustering Parameters.\(\triangleright\)Initialization. 2:Choose an initial integer number \(K\) randomly from the interval \([K_{\min},K_{\max}]\). 3:Generate initial centers \(X=\{x^{1},\ldots,x^{K}\}\). 4:Apply \(K\)-means to adjust centers \(X\). 5:Annealing Parameters. Set the following cooling schedule parameters:
6:Initial temperature \(T_{max}\). 7:Final temperature \(T_{min}\). 8:Cooling reduction ratio \(\lambda\in(0,1)\). 9:Epoch length \(M\). 10:Control temperature \(T=T_{max}\). 11:Diversification Parameter. Set a value for the diversification parameter \(n_{div}\). 12:for\(i=1\) to \(M\)do\(\triangleright\)Main Loop
13:Compute a trial solution as \(Y=X+\Delta X\) with a step size \(\Delta X\). 14:Apply \(K\)-means clustering to adjust the centers \(Y\). 15:if\(SF(Y)>SF(X)\)then
16:\(Y\) is accepted. 17:else
18:\(Y\) is accepted with probability \(p=e^{\frac{-\Delta SF}{I}}\), where \(\Delta SF=SF(X)-SF(Y)\). 19:endif
20:if\(Y\) is accepted then
21: Set \(X=Y\). 22: Update the best solution if a new best solution is obtained. 23:endif
24:endfor
25:if\(T<T_{min}\)then\(\triangleright\)Termination. 26:Terminate the algorithm. 27:else
28: Set \(T=\lambda T\). 29:endif
30:endif
31:if the number of consecutive non-improvement loops equals \(n_{div}\)then\(\triangleright\)Diversification. 32:Apply Procedure 4 to generate new diverse centers \(X^{div}\). 33:Set \(X=X^{div}\), and go to Step 4. 34:endif
35:Apply Procedure 1 to merge or split clusters. \(\triangleright\)Cluster Merging and Splitting
36:Set \(X\) equal to the obtained merged or split centers and go to Step 4. Using KMC, the accurate number of clusters can be found automatically with reasonable runtime and acceptable competing accuracy. The epoch length is responsible for determining the best centers for number of clusters, the split and merge procedure issues criterion functions to select clusters to be split or merged, and fitness assessments on cluster structure changes. ## 4 Experimental Setup

In this section, the comparison strategy of KMC algorithm is described. We describe how the parameters were set and the comparisons were conducted. Also, brief descriptions of the datasets and the algorithms used in comparisons are presented. ### Test Bed

To evaluate the performance of the proposed algorithm, five synthetic and two real datasets. The real datasets extracted from UCI public data repository [75]. Table 1 presents the number of instances, attributes and the number of clusters of each dataset. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Name** & **Points** & **Dimensions** & **Actual Clusters** & **Type (Synthetic/Real)** \\ \hline Overlap 3 & 150 & 2 & 3 & S \\ Separate 3 & 150 & 2 & 3 & S \\ Separate 4 & 400 & 2 & 4 & S \\ Overlap 5 & 250 & 2 & 5 & S \\ Separate 6 & 300 & 2 & 6 & S \\ Iris & 150 & 4 & 3 & R \\ Breast cancer & 683 & 9 & 2 & R \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Description of the datasets. Figure 6: KMC flowchart. 1. Separate 3: This dataset was produced by sampling outputs with normal distributions from a cluster generator. It consists of 150 two dimensional data points distributed over three spherically-shaped clusters. The clusters are highly overlapping, each consists of 50 data points. This dataset is shown in Figure 7a. 2. Overlap 3: It is similar to Separate3 except it is in three-dimensional space and distributed over four hyper-spherical disjoint clusters. Each cluster contains 50 data points. This dataset is shown in Figure 7b. 3. Overlap 5: This dataset was used in [69]. It consists of 250 two dimensional data points distributed over five spherically shaped clusters.