# Simple K-Medoids Partitioning Algorithm for Mixed Variable Data
## 3 Demonstration on Artificial and Real Datasets  
To apply the proposed k-medoids algorithm (SKM) and distance (GDF), simulated datasets with specified classes (\"true clusters\") are generated. The authors of [24] generated artificial data with only numerical variables in arbitrary diameters, shapes, and orientations. In order to obtain a binary/categorical variable for the simulation data, a numerical variable is categorized via a quantile categorization. The categorization of a numerical variable into a binary/categorical variable is obtained by dividing the numerical variable into \(c\) classes with the 100/\(c\)% quantile as the cut point. Thus, a binary variable is achieved when the median of the numerical variable is applied as a cutoff point. The artificial data have a degree of separation parameter [25] that has to be pre-specified. The degree separation values range from \(-1\)-\(1\), where one indicates the best-separated clusters. Due to the focus of the study on the different settings of the mixed variable datasets, the degree separation is fixed arbitrarily to 0.2, and all variables are important variables. The mixed variable datasets have four different settings. The variations are in the variables' proportion, number of clusters, number of variables, and number of objects. Each setting of the artificial datasets is partitioned by applying the GDFs (Table 1) as the input. Due to the possibility of other combinations of distances and weights in the GDF, two distances derived from the GDF are added, namely the Esimma and Marweco GDFs (Table 2). While the former combines the Euclidean and simple matching distances, the latter sums the Manhattan range weighted distance with the co-occurrence distance. Both GDFs set all of the weights to one. Then, the k-medoids algorithms, which is compared in this article, are the PAM, the most popular medoid-based algorithm, SFKM, the evaluated algorithm, and SKM (\(s=20\)), the proposed algorithm. To evaluate the algorithms' performance, the Rand indices are calculated and averaged via a subsetting strategy [26] in 50 replications of the seven GDFs (Tables 1 and 2). The Rand index is given by:  
\[ri=\frac{a+b}{nC_{2}},\]  
where \(a\) and \(b\) are the number of pairs of objects in the data. If both object pairs are in the same cluster under the \"true cluster\" and are also in the same cluster under the particular algorithm, it belongs to \(a\). Meanwhile, \(b\) indicates that both object pairs are in a different cluster in both the \"true cluster\" and particular algorithm. We also used six real datasets without any missing value from the UCI machine learning repository [27]. These data are the Iris, Wine, Soybean, Vote, Zoo, and Credit approval datasets (Table 3). They were selected due to being commonly used to compare clustering algorithms. Each dataset was analyzed using the proposed SKM algorithm that was applied in the GDFs (Tables 1 and 2). The performance comparison among GDF variations was based on the clustering accuracy index where perfect clustering had a value of one, and failure of clustering was zero. To produce the k-medoids algorithms and GDF variations, the analyses were run in the R software [28] applying several packages. The main package was the kmed package [20], which applied the SFKM algorithm and GDFs, while the PAM algorithm was applied in the cluster package [29]. The SKM algorithm, on the other hand, was written in an R code and is available in the Supplementary Material. The clusterGeneration [30] was also applied to generate the artificial data; the flexclust