# An Optimal and Stable Algorithm for Clustering Numerical Data
## 3 Proposed Clustering Algorithm with a Constant Seeding Selection
### Computational Complexity  
In terms of the overall computational complexity, the Zk-AMH algorithm is linearly proportional to the size of the dataset with \(O(kmn)\in O(n)\), where \(k\) is the number of clusters, \(m\) is the number of dimensional spaces, and \(n\) is the number of objects. The time taken for the new seeding is considered to be \(O(1)\) because the seeding is assigned once for the initialization. It is nearly similar to the computational complexity of the k-means algorithm, which is \(O(nkt)\), where \(n\) is the number of objects, \(k\) is the number of clusters, and \(t\) is the number of iterations required for its iteration processes. The detailed time complexity and scalability testing for the k-AMH algorithm is reported in [17]. ```
Input: dataset \(X\), number of clusters \(k\), and weighting exponent \(\psi\)

Output: Set of clusters \(C=\{C_{1},C_{2},\ldots,C_{k}\}\)
```
1: Initialize Zero points, \(\hat{Z_{lc}}\in O_{m}\), where \(1\leq l\leq k\) and \(1\leq c\leq m\)
2:for each \(\hat{Z_{l}}\)do
3:for each \(X_{i}\)do
4: Calculate \(F(W,D)\) as Equation (8)
5:if\(F(W,D)\) is minimized then
6: Replace \(\hat{Z_{l}}\) with \(X_{i}\) as Equation (22)
7:endif
8:endfor
9:endfor
10: Assign \(X_{i}\) to \(C_{l}\) for all \(l\), \(1\leq l\leq k\) and \(i\), \(1\leq i\leq n\)
11: Output results
```

**Algorithm 4** Zk-AMH(\(X,k,\psi\)). ## 4 Experimental Setup

### Dataset

Eight real-world numerical datasets were used to evaluate the algorithm performance: the Iris, Pima, Haberman, Wine, Seed, User Knowledge, E-coli, and Cleveland datasets from the UC Irvine (UCI) machine learning repository [32]. The experiments were focused on measuring the cluster optimality and stability of the newly proposed algorithm. These datasets cover various scenarios such as number of attributes, ranging from 3 to 13, and the number of classes, ranging from 2 to 8. Table 1 summarizes the datasets used in this experiment. ### Evaluation Method

A 100-run experiment was conducted for each algorithm and dataset for further analysis. On top of the proposed algorithm (the Zk-AMH), the other six algorithms were used for comparison. Table 2 lists and summarizes the algorithms. \begin{table}
\begin{tabular}{l l c c c} \hline \hline \multirow{2}{*}{**Dataset**} & \multirow{2}{*}{**Description**} & \multicolumn{3}{c}{**Number of**} \\ \cline{3-5}  & & **Objects** & **Classes** & **Attributes** \\ \hline
1. Iris & The Iris dataset is used to analyze the three types of Iris plants. & 150 & 3 & 4 \\ \hline
2. [PERSON] & [PERSON]’s survival dataset is used for breast cancer studies. & 306 & 2 & 3 \\ \hline
3. Pima & The Pima Indians Diabetes Dataset was provided by the National & 393 & 3 & 8 \\  & Institute of Diabetes and Digestive and Kidney Diseases. & & 178 & 3 & 13 \\ \hline
4. Wine & The Wine dataset is used for chemical analysis of wines grown in a & 210 & 3 & 7 \\  & specific region of Italy. & & 210 & 3 & 7 \\ \hline
5. Seed & The Seed dataset is used to compare three different varieties of wheat: & & 403 & 4 & 5 \\  & Kama, Rosa, and Canadian. & & 336 & 8 & 7 \\ \hline
6. User knowledge & The User knowledge dataset is employed to study the knowledge & & & & \\  & status of students about electrical Direct Current (DC) machines. The & & & & \\  & dataset was the combination of a 258-item training set and 145 item & & 403 & 4 & 5 \\  & test set. & & & & \\ \hline
7. E-coli & The E-coli dataset is used to predict protein localization sites. & 336 & 8 & 7 \\ \hline
8. Cleveland & The Cleveland dataset is used to diagnose coronary artery disease. & & & & \\  & The dataset contained 303 items with 75 attributes and was divided & & 297 & 5 & 5 \\  & into 5 classes. However, the dataset was filtered down to 297 items & & & & \\  & with only 5 numerical attributes. & & & & \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Summary of Numerical datasets. An external criterion was used to evaluate the clustering performance.