# Ellipsoidal K-Means: An Automatic Clustering Approach for Non-Uniform Data Distributions
## 2 Adaptive Ellipsoidal Clustering Technique
### Ellipsoidal Clustering Technique  
The algorithm builds clusters around appropriate centers and transforms elliptical clusters into circular or spherical clusters, thus preparing the dataset to be subjected to the _SF_fitness function.  
In two dimensions, converting an ellipse into a circle is relatively straightforward, regardless of whether it is aligned with the coordinate axes. When the ellipse is aligned, as shown in Figure 1a, it is easy to determine the major and minor axes. For ellipses that are not aligned with the axes, a rotation matrix is used to rotate the group around a fixed point, the center of rotation, in order to align it with the coordinate axes, as shown in Figure 2a.  
Figure 1: (**a**) Ell_2_2 represents an artificial dataset comprising two groups of data points generated using a Gaussian distribution. (**b**) Three clusters resulting from the application of the silhouette function (SF) measure on Ell_2_2.  
After alignment, the semi-major and semi-minor axes of the ellipse, designated as \(a\) and \(b\), respectively, can be determined.  
To transform elliptical clusters into hyperspherical ones, we apply the following transformation: \(X=x\) and \(Y=\frac{a}{b}y\), where \(x\) represents points on the minor coordinate axis and \(y\) on the major axis. Figure 3a,c show the results after application of the rotation matrix.  
The rotation matrix can also be applied in three dimensions by transforming datasets into the second and third dimensions. However, manipulating rotation matrices beyond the third dimension poses significant problems. Transforming clusters into hyperspherical clusters in n-dimensional datasets using rotation matrices is not only difficult but also mathematically complex. Consequently, an alternative method for solving this problem is being considered and will be further explored in future research.  
Figure 3: Clustered Ell_2_2 for \(K=2\) and \(K=3\) for Ell_3_2, (**a**,**c**) represent the data after applying 2-D transformation. (**b**,**d**) show the data after applying N-D transformation Equation (13).  
Figure 2: (**a**) Ell_3_2 is a synthetic dataset consisting of three groups of data points resembling a percent mark generated by Gaussian distribution. (**b**) Dataset_3_2 is a synthetic dataset consisting of three clusters, as utilized in [28].  
We set \(\|x_{i}^{s}\|=b\) when \(\|x-c_{k}\|>b\), meaning that any point outside the new spherical cluster is relocated to the surface of this sphere.  
The resulting shape is a hyperspherical cluster, which slightly differs from the one obtained using the rotation matrix. The transformation of points is not uniform and depends on their distance from the center, as illustrated in Figure 3.  
By calculating the centers of the optimal clusters and the new hyperspherical clusters, it becomes clear that the centers remain constant and equal. For instance, the centers for Ell_2_2, as shown in Figure 1a, are \(\{-0.0037,0.2878\}\) and \(\{2.2434,1.5262\}\). These centers remain unchanged after applying the ellipsoidal clustering technique, as demonstrated in Figure 3a,b.