# Context-Based Geodesic Dissimilarity Measure for Clustering Categorical Data
## 4 Results
### Comparative Study Using Real-Life Datasets  
In our experiments, a clustering algorithm is applied to four benchmark datasets: (1) Breast cancer, (2) Soybean, (3) Lymphography, and (4) Mushroom, which were from the UCI Machine Learning Repository [35]. All datasets, except the Lymphography dataset, have missing values. In this study, we simply eliminate the observations with missing values. Furthermore, the Lymphography dataset is originally composed of eighteen variables in total, including three continuous variables and fifteen categorical (nominal) variables so that three of these continuous variables are forcibly discretized into categorical (ordinal) variables. Table 4 summarizes these datasets, including the results of the dependency analysis. Before we conducted the experiments of applying a clustering algorithm to those four benchmark datasets, we performed a dependency analysis in the same manner in [8] to find how significantly correlated several categorical variables are. For each dataset \(\mathbf{x}\), we evaluate the categorical data dependency using the dependency factor \(\rho(\mathbf{x})\), which is the proportion of the number of dependent categorical variable pairs in the total number of categorical variable pairs. The dependency factor is calculated by the following equation  
\[\rho(\mathbf{x})=\frac{\text{Number of dependent categorical variable pairs}}{p(p-1)}, \tag{9}\]  
where \(p\) is the number of variables. To test the dependency of two categorical variables, we used the chi-square statistic with a significance level of 0.05. The dependency factor has a value of 0-1, where 0 indicates that all categorical variable pairs are independent, and 1 indicates that all categorical variable pairs are dependent at the significance level of 0.05. Figure 3: Mutual \(k\)-nearest neighbor graph with \(k=9\). Figure 2: Mutual \(k\)-nearest neighbor graph with \(k=6\). Most of the categorical variables in the selected real-life datasets are correlated, as shown in Table 4. We believe that these real-life datasets can adequately illustrate the usefulness of the proposed method. For clustering, we used the Partition Around Medoid (PAM) clustering algorithm [36] to study the performance of the proposed method. The PAM algorithm is the most well-known heuristic solution for the \(k\)-medoids clustering [14; 37]. The \(k\)-medoids clustering is more robust to outliers than the \(k\)-means clustering algorithms [38] and can work using a dissimilarity matrix, which is defined by any dissimilarity measure (our proposed method provides only a dissimilarity matrix, not the node (observation) coordinates). Hence, the PAM algorithm is used to compare our proposed method with the existing ones. A brief explanation of the PAM can be provided as follows; given \(K\) initial medoids that create \(K\) clusters, each node becomes assigned to one of the \(K\) medoids that is nearest to the node. A medoid can be defined as the node of a cluster whose average dissimilarity to all nodes in the cluster is minimal. The PAM minimizes the objective function by iteratively swapping all non-medoid points and medoids until convergence [36]. The objective function of the PAM is to minimize the sum of the dissimilarities from a node to its cluster medoids. To quantify the PAM clustering performance, the clustering validity measure is required. Based on the available knowledge about the true class membership of the dataset, the whole clustering validity measures can be divided into two sets; internal and external validity measures [39]. Internal validity measures only exploit the distribution of the dataset. On the other hand, external validity measures assume some external information, such as class membership information. It is obvious that external validity measures give less vague results than the internal validity measures as the association of the cluster points with the class membership is assumed to be known in the case of external validity measures.