Computational Intelligence and Neuroscience

Computational Intelligence and Neuroscience / 2017 / Article

Research Article | Open Access

Volume 2017 |Article ID 8986360 | 11 pages | https://doi.org/10.1155/2017/8986360

Clustering Categorical Data Using Community Detection Techniques

Academic Editor: Elio Masciari
Received30 Aug 2017
Revised08 Nov 2017
Accepted16 Nov 2017
Published21 Dec 2017

Abstract

With the advent of the -modes algorithm, the toolbox for clustering categorical data has an efficient tool that scales linearly in the number of data items. However, random initialization of cluster centers in -modes makes it hard to reach a good clustering without resorting to many trials. Recently proposed methods for better initialization are deterministic and reduce the clustering cost considerably. A variety of initialization methods differ in how the heuristics chooses the set of initial centers. In this paper, we address the clustering problem for categorical data from the perspective of community detection. Instead of initializing modes and running several iterations, our scheme, CD-Clustering, builds an unweighted graph and detects highly cohesive groups of nodes using a fast community detection technique. The top- detected communities by size will define the modes. Evaluation on ten real categorical datasets shows that our method outperforms the existing initialization methods for -modes in terms of accuracy, precision, and recall in most of the cases.

1. Introduction

Clustering task is a form of unsupervised learning that aims at finding underlying structures in unlabeled data. Objects are partitioned into homogeneous groups or clusters so that intracluster items have high similarity but are very dissimilar to objects in other clusters. A lot of clustering methods have been proposed and developed over decades (for a recent survey, see [1]). Hierarchical clustering and partitional clustering are two main types of clustering algorithms. While hierarchical clustering produces a hierarchy of partitions (i.e., a dendrogram) over the dataset by applying agglomerative or divisive strategies, partitional clustering usually assumes a fixed number of clusters and tries to maximize the homogeneity within the clusters.

For numerical data, the -means algorithm is a well-known and widely used method in practice due to its simplicity and efficiency. -means finds a set of cluster centers for a dataset such that the sum of squared distances of each point to its nearest cluster center is minimized. Lloyd’s algorithm [2] begins with arbitrary centers, typically chosen uniformly at random from the data points. Each point is then assigned to the nearest center, and each center is recomputed as the center of mass of all points assigned to it. These two steps are repeated until the process stabilizes. To remove the numeric-only limitation of the -means algorithm, Huang [3] developed the -modes algorithm which extends the -means algorithm by using (1) a simple matching dissimilarity measure for categorical attributes (2) modes in place of means for clustering and (3) a frequency-related strategy to update modes to minimize the clustering cost. The algorithm is shown to achieve convergence with linear time complexity with respect to the number of data items.

However, the -modes algorithm is also very sensitive to the choice of initial cluster centers and an improper choice may result in highly undesirable cluster structures. The same phenomenon happened in -means which led to the better seeding solutions such as k-means++ [4] and its derivatives -means [5] and - [6]. To better initialize cluster centers in -modes, a lot of methods have been developed [710]. The common point of [7, 8, 10] is to use the density of each data point together with the distance to determine sequentially the initial cluster centers. Khan and Ahmad [9] proposed to use multiple clustering of the data based on attribute values in different attributes.

In this paper, we develop a new clustering method for categorical data based on community detection techniques [11]. Considering each data point as a node, we build a simple graph in which an edge connects any two nodes if the Hamming distance between them is less than a threshold. The threshold is simply estimated via the number of data points , the number of clusters , and the pairwise Hamming distance distribution. Given the graph , we run the Louvain algorithm [12] to detect nonoverlapping cohesive communities within . The top- communities by size will be retained as the core clusters, each of which is represented by a mode. The remaining data points (if any) are assigned to the nearest mode. Note that our algorithm is not an initialization technique as [3, 710] because it produces clusters directly.

Compared to prior work, our scheme highlights the following features:(i)We propose a novel clustering method called CD-Clustering for categorical data using community detection techniques. Our scheme uses a simple heuristic to determine the distance threshold for graph construction. It is also deterministic as opposed to the traditional -modes with random initialization of cluster centers.(ii)We evaluate our scheme on ten real categorical datasets and compare it against random initialization and two other initialization methods. The results show that our technique performs better than the competitors in terms of accuracy for most of the cases.

The remainder of the paper is organized as follows. Section 2 briefly reviews related work in -modes clustering and community detection. Section 3 discusses several key concepts used in this paper via some illustrative examples. In Section 4, we describe a simple estimation of the distance threshold and our main algorithm. The evaluation and comparison are shown in Section 5. Finally, Section 6 concludes the paper with pointers to future work.

2.1. -Modes and Initialization Techniques

As in -means, the random initialization method has been widely used in -modes clustering for its simplicity. However, the random method does not guarantee a unique clustering result, and very poor clustering results may occur. To obtain desirable clustering results with low distortion, the -modes algorithm must be executed many times.

In [3], Huang proposed two simple initialization methods for -modes, in which the first method selects the first objects from the dataset as initial cluster centers, and the second method assigns the most frequent categories equally to the initial cluster centers. However, the first method works only if the first objects come from disjoint clusters while the second method lacks a uniform criterion for selecting initial clusters.

Wu et al. [10] proposed a density based initialization method for -modes. Cao et al. [8] presented a method to select initial cluster centers by considering the distance between objects and the density of each object. Bai et al. [7] proposed an initialization method that is similar to [8] but tries to avoid selecting the boundary objects among clusters as the first cluster center. However, the evaluation of results in [7] has some problems: for several datasets, the accuracy, precision and recall values are computed incorrectly as reported by Khan and Ahmad [9]. In [9], Khan and Ahmad presented an initialization algorithm for -modes by performing multiple clustering of data based on the attribute values present in different attributes.

A long with the heuristics for cluster initialization discussed above, there are many ideas on improving the dissimilarity scores for the standard -modes algorithm [1316]. Ng et al. [15] gave a rigorous proof that the object cluster membership assignment method and the mode updating formula under the dissimilarity measure proposed in [14] indeed minimize the objective function. Cao et al. [13] proposed a new dissimilarity measure to take into account of the distribution of attribute values on the whole universe. In [16], Zhou et al. took a step further by defining the Global-Relationship dissimilarity (GRD) measure.

2.2. Community Detection in Graphs

There is a vast literature on community detection in graphs. For a recent comprehensive survey, we refer to [11]. In this section, we discuss several classes of techniques.

Newman and Girvan [17] propose modularity as a quality of network clustering. It is based on the idea that a random graph is not expected to have a modular structure, so the possible existence of clusters is revealed by the comparison between the actual density of edges in a subgraph and the density one would expect to have in the subgraph if the nodes of the graph were connected randomly (the null model).

Many methods for optimizing the modularity have been proposed over the last ten years, such as agglomerative greedy [18], simulated annealing [19], spectral optimization [20], and Louvain method [12], just to name a few. Other methods include random walks [21], statistical mechanics [22], label propagation [23], and InfoMap [24]. The recent multilevel approach, also called Louvain method, by Blondel et al. [12] is among top performance schemes. It scales very well to graphs with hundreds of millions of nodes/edges.

3. Preliminaries

In this section, we review several key concepts in the -modes algorithm and community detection techniques. We also discuss how the clustering problem of categorical data can be solved from the perspective of community detection.

Notations summarizes the notation used in this paper.

3.1. Clustering Categorical Data

Let be a categorical dataset with data points . Each data point has categorical attributes from the set . In other words, the dataset can be represented by a table with rows and columns in which indicates the th attribute of the data point .

The -modes clustering algorithm [3] is an extension of the -means algorithm for clustering categorical data by using a simple dissimilarity measure. It also adopts a frequency-related strategy to update modes in the clustering to minimize the clustering costs. The simplest matching dissimilarity measure between two data points and is defined by Hamming distance: where denotes the th attribute of and if or otherwise. Obviously, the Hamming distance between any two data points lies in the set .

Given a set of data points , a mode of is an object where that minimizes the sum . In other words, is the most frequent value in with respect to the th attribute [3]. Note that is not necessarily an object of . When a mode is not an object of a set, it can be assumed as a virtual object.

The original -modes algorithm [3] tries to minimize the following cost function: where and . The -modes algorithm [3] runs the following steps:(1)Select initial modes, one for each cluster.(2)Allocate an object to the cluster whose mode is the nearest to it. Update the mode of the cluster after each allocation using the most frequent attribute values.(3)After all objects have been allocated to clusters, retest the dissimilarity of objects against the current modes. If an object is found such that its nearest mode belongs to another cluster rather than its current one, reallocate the object to that cluster, and update the modes of both clusters.(4)Repeat (3) until no object has changed clusters after a full cycle test of the whole dataset.

3.2. Community Detection via Modularity Optimization

Given a simple graph with disjoint communities, the modularity is defined aswhere is the number of clusters, is the total number of edges joining nodes in community , and is the sum of the degrees of the nodes of . Modularity is a scalar value in the range with larger values implying better clustering.

Example 1. Using Figure 1, we illustrate how to compute the modularity of a graph with respect to a clustering . The graph has six nodes and seven edges (). In Figure 1(a), the clustering is , so (two clusters). For the first cluster, . For the second cluster, . Hence, following formula (3), the modularity is .
Similarly, for the clustering on Figure 1(b)   , the modularity is . Clearly, the modularity of is higher than that of . This fact is also confirmed by looking at the two types of clustering in which partitions the nodes into more homogeneous groups.

Since its introduction in 2008, Louvain method [12] becomes one of the most cited methods for the community detection task. It optimizes the modularity by a bottom-up folding process. The algorithm is divided into passes, each of which is composed of two phases that are repeated iteratively. Initially, each node is assigned to a different community. So, there will be as many communities as there are nodes in the first phase. Then, for each node , the method considers the gain of modularity if we move from its community to the community of a neighbor (a local change). The node is then placed in the community for which this gain is maximum and positive (if any); otherwise it stays in its original community. This process is applied repeatedly and sequentially for all nodes until no further improvement can be achieved and the first pass is then complete.

Example 2. We demonstrate Louvain method in Figure 2 with a graph of 13 nodes and 20 edges. If each node forms its own singleton community, the modularity will be . In the first pass of Louvain method, each node moves to the best community selected from its neighbors’ communities. We get the partition with modularity 0.46375. The second phase of first pass builds a weighted graph corresponding to the partition by aggregating communities. The second pass repeats the folding process on this weighted graph to reach the final partition with modularity 0.47.

This greedy agglomerative algorithm has several advantages as stated in [12]. First, its steps are intuitive and easy to implement, and the outcome is unsupervised. Second, the algorithm is extremely fast, that is, computer simulations on large modular networks suggest that its complexity is linear on typical and sparse data. This is due to the fact that the possible gains in modularity are easy to compute and the number of communities decreases drastically after just a few passes so that most of the running time is concentrated on the first iterations. Third, the multilevel nature of the method produces a hierarchical structure of communities which allows multiresolution analysis, that is, the user can zoom in the graph to observe its structure with the desired resolution.

Note that in Louvain method, the move of nodes to gain better modularity is restricted to neighbor (connected) communities. Therefore, detected communities belong to one and only one connected component. In other words, a community never spans different connected components of a graph.

4. Algorithm

4.1. Estimation of Hamming Distance Threshold

To build the graph for the dataset , we need to estimate the distance threshold so that any two data points and are connected if the Hamming distance . As mentioned in Section 3.1, the Hamming distance lies in the set . At one extreme , the graph has least edges which exist between duplicate data points only. At the other extreme , we get a complete graph : any two nodes are connected. Obviously, some values of the distance threshold will make look more modular than the others; that is, its nodes are well clustered in communities and therefore easier to detect.

In this paper, we propose a simple heuristic to estimate based on the distribution of Hamming distances between data points in given the number of clusters . With data points, there are pairwise distances. Trivially assuming that clusters are of equal size, each cluster will have points and the number of intracluster distances in each cluster is . In total, there are intracluster distances. In practice , so the ratio of intracluster distances over the number of pairwise distances is

In other words, given the cumulative distribution function (CDF) of pairwise distances, we can estimate at the point that and . Figure 3 illustrates this idea for the ten datasets used in our experiments.

We also observe that the expected Hamming distance between two random data points is large when the attribute values are assumed to be uniformly distributed. Specifically, given the set of attributes , the expected Hamming distance between two random data points and is where is the cardinality of the th nonsingleton attribute. The larger , the larger the expected Hamming distance.

4.2. Clustering Algorithm

Now we describe our community detection-based clustering scheme (named CD-Clustering) which is outlined in Algorithm 1. The scheme consists of two phases. In the first phase, we compute all pairwise Hamming distances and the CDF of distance distribution (Lines (1)-(2)). Then, we estimate the distance threshold using a simple assumption in Section 4.1 (Lines (4)–(6)). In the second phase, we build the graph in which each node represents a data point. Two nodes are connected by an edge if their Hamming distance is not larger than (Lines (8)–(11)). In Line (12), we run the Louvain method [12] on to detect highly cohesive groups of nodes. The top-   detected communities by size will be retained (Line (13)). Then, we determine the mode for data points in each community (Lines (14)-(15)). The remaining data points (i.e., data points that do not belong to any of the top- communities) are assigned to the nearest mode (Lines (16)-(17)). As we show later in Section 5, except the dataset Mushroom, the number of remaining data points is very small.

Input: dataset with data points, each data point has
attributes. The number of clusters .
Output: clusters of data points .
compute pairwise Hamming distances
compute CDF for pairwise Hamming distances
// estimate distance threshold
for     do
(5) if   and   then
(6)break
(7) // clustering
(8)
(9)for     do
(10) if     then
(11)
(12) run Louvain method [12] on
(13) keep top- communities by size
(14)for each cluster   do
(15) compute the mode of
(16)for each remaining data point   do
(17) assign to the nearest mode ,
(18)return  

The complexity of CD-Clustering is dominated by the computation of all pairwise Hamming distances and the Louvain method. All pairwise Hamming distances are computed in . The Louvain method runs empirically in the time linear to the number of edges [12]. Again, using the simple assumption that all clusters are of equal size, the number of intracluster distances is approximated as . So the number of edges in is also , making the runtime of Louvain method is . In total, the complexity of CD-Clustering is . The quadratic complexity is a main drawback of our CD-Clustering scheme which restricts its application to datasets of 50,000 data points or less. A similar scalability limitation appears in [25] in which the authors need a similarity matrix of size . An approximation of Hamming distance distribution is possible by considering, for example, the distances from any point to (instead of all ) other points. The complexity in this approximation scheme will be reduced to . We leave this idea for future work. Table 1 compares the time complexity of our CD-Clustering scheme with the two initialization methods [8, 9].


Clustering method Time complexity

Cao et al. [8]
Khan and Ahmad [9]
CD-Clustering

5. Evaluation

In this section, we evaluate the performance of the proposed scheme. The real-world datasets and evaluation metrics are described in Sections 5.1 and 5.2. We show the performance of our method in Section 5.3. The clustering algorithm is implemented in C++ and run on a desktop PC with Intel® Core i7-6700@ 3.4 Ghz, 16 GB memory. For the sake of reproducibility, we provide our source code with the data (https://gitlab.com/hiepnh.duytan/Research/tree/master/k-modes-community).

5.1. Datasets

We pick ten purely categorical datasets from the UCI Machine Learning Repository [26] with a short description for each dataset as follows. Compared to the datasets used in [9], we add three new datasets: Nursery, Chess, and Heart. Note that we consider missing attribute values “?” as a new attribute value.

Soybean Small. This dataset consists of 47 cases of soybean disease each characterized by 35 multivalued categorical variables. These cases are drawn from four populations, each one of them representing one of the following soybean diseases: D1-Diaporthe stem canker, D2-Charcoat rot, D3-Rhizoctonia root rot, and D4-Phytophthorat rot. We keep only 21 nonsingleton attributes.

Mushroom Data. Mushroom dataset consists of 8,124 data objects described by 22 categorical attributes distributed over 2 classes. The two classes are edible (4208 objects) and poisonous (3916 objects). It has missing values in attribute 11.

Zoo Data. It has 101 instances described by 16 attributes and distributed into 7 categories. The first attribute contains a unique animal name for each instance and is removed because it is noninformative. All other characteristics attributes are Boolean except for the character attribute which corresponds to the number of legs that lies in the set .

Lung-Cancer Data. This dataset contains 32 instances described by 56 attributes distributed over 3 classes with missing values in attributes 5 and 39.

Breast-Cancer Data. This data has 699 instances with 9 attributes. Each data object is labeled as benign (458 or 65.5%) or malignant (241 or 34.5%). There are 9 instances in attributes 6 and 9 that contain missing attribute values.

Dermatology Data. This dataset contains six types of skin diseases for 366 patients that are evaluated using 34 clinical attributes, 33 of them are categorical and one is numerical. The categorical attribute values signify degrees in terms of whether the feature is present and contain largest possible amount or relative intermediate values. In our experiment, we discretize the numerical attribute (representing the age of the patient) into 10 categories.

Congressional Vote Data. This dataset includes votes for each of the US House of Representatives Congressmen on the 16 key votes. Each of the votes can either be a yes, no, or an unknown disposition. The data has 2 classes with 267 democrats and 168 republicans instances.

Nursery. This dataset was derived from a hierarchical decision model originally developed to rank applications for nursery schools. It contains 12,960 instances with 8 input attributes distributed over 5 classes.

Chess. This dataset contains 3,196 instances, each of which is a board-description for the chess endgame with 36 features. Each game is labeled one of the two classes: “win” and “nowin.”

Heart Disease. This dataset is the Cleveland heart disease database of 303 patients. The class represents presence of heart disease in the patient from 0 to 4. There are 13 attributes used in the experiments. We convert 5 numeric attributes (1st, 4th, 5th, 8th, and 10th) to categorical ones using the intervals of 10, 20, 60, 30, and 0.7, respectively. The 12th and 13th attributes contain missing attribute values.

Table 2 lists the characteristics of the chosen datasets. The columns avg.intra.dist and avg.inter.dist show the average intracluster and intercluster distances for each dataset, respectively.


Dataset avg.intra.distavg.inter.distAC#comptop-Runtime (ms)

Soybean4721475.5412.481.000024634731
Mushroom8,1242221110.1112.680.724412,924,40715,3668,284
Zoo10116722.407.750.82187017100109
Lung-Cancer325632224.2026.090.5938160429110
Breast-Cancer6999264.277.840.9514115,068169993
Dermatology3663461011.2316.410.85529,5884364125
Vote43516286.4110.810.871347,102143293
Nursery12,9608535.035.670.41565,721,840112,9602,543
Chess3,19636299.6510.350.60042,395,17412,3892,012
Heart30313556.587.850.47197,755230294

The column R shows the value of Hamming distance threshold estimated from the CDF (see Figure 3). AC is the accuracy of our CD-Clustering. We highlight the accuracy values that are larger than 0.8. The columns m, #comp, and top- display the number of edges in , the number of connected components in , and the total number of data points in top- clusters, respectively. Except Mushroom and Chess datasets, the top- clusters detected by CD-Clustering include all or nearly all the data points. This result verifies the effectiveness of the simple estimation of and the Louvain method. Finally, the column Runtime shows the runtime of CD-Clustering in millisecond which is almost linear in .

5.2. Evaluation Metrics

To evaluate the performance of clustering algorithms, we use the same metrics as in [8, 9, 15]. If dataset contains classes for a given clustering, let denote the number of data objects that are correctly assigned to class , let denote the data objects that are incorrectly assigned to the class , and let denote the data objects that are incorrectly rejected from the class . The precision, recall, and accuracy are defined as

We demonstrate how to find the best confusion matrix and compute the precision, recall, and accuracy metrics in the following example.

Example 3. Assume that a dataset of objects clustered in clusters with the ground-truth and predicted cluster labels as in Table 3.
To find the best confusion matrix , we evaluate mappings from the set predicted labels to the ground-truth . For example, the mapping gives us the confusion matrix in Table 4. The value in each cell, for example, , is the number of pairs appearing in Table 3. Note that the sum of each column is equal to the number of objects in the corresponding cluster. The values of precision, recall, and accuracy areThe best mapping in this case is with , , and .


Object id 1 2 3 4 5 6 7 8 9 10
Ground-truth label 1 1 1 2 2 2 2 3 3 3
Predicted label b b a b a c b a a c


1 2 3
c0 1 1
a 11 2
b 2 20

5.3. Clustering Results

For comparison, we choose the algorithms by Cao et al. [8] and Khan and Ahmad [9] as well as the random -modes [3]. We rerun the Java implementation provided in [9] and get a confusion matrix for each dataset. Then we find the best evaluation metrics using the brute-force technique in Example 3. Surprisingly, the metrics for seven datasets reported in [9] are not so good. They only match for the case of Vote data and get better value for Soybean and worse values on the other five datasets. For Cao’s algorithm, our C++ implementation provides the matching results on three out of four datasets tested in [8], namely, Soybean, Mushroom, and Breast-Cancer. The worse metrics appear on Zoo data. However, our results agree with the Python implementation of Cao’s algorithm at [27]. The results for random -modes with 10,000 runs/dataset are also more or less different from [8, 9].

The clustering results for the ten categorical datasets are summarized in Tables 514. In terms of accuracy, precision, and recall, our scheme achieves the following results:(i)Accuracy: our scheme outperforms or equals other methods in 7 cases, in particular with large margins in Lung-Cancer, Breast-Cancer, Dermatology, and Nursery datasets.(ii)Precision: our scheme outperforms or equals other methods in 7 cases.(iii)Recall: our scheme outperforms or equals other methods in 7 cases.

(a) Confusion matrix

Class
D1D2D3D4

D110000
D201000
D300100
D400017

(b) Performance comparison

RandomCaoKhanProposed

AC0.804410.97871
PR0.796910.97731
RE0.800510.98531

(a) Confusion matrix

Class
PoisonousEdible

Poisonous40932124
Edible1151792

(b) Performance comparison

RandomCaoKhanProposed

AC0.72060.87540.82880.7244
PR0.74480.90190.86880.7990
RE0.71670.87090.82280.7151

(a) Confusion matrix

Class
abcdefg

a37000000
b01300001
c00200001
d0009800
e4000000
f0000043
g0001000

(b) Performance comparison

RandomCaoKhanProposed

AC0.70410.67330.86140.8218
PR0.58760.59960.73900.5688
RE0.58930.62330.76480.6861

(a) Confusion matrix

Class
abc

a522
b571
c307

(b) Performance comparison

RandomCaoKhanProposed

AC0.52270.53130.43750.5938
PR0.55900.58330.44680.5980
RE0.52830.53930.44700.6208

(a) Confusion matrix

Class
Benign Malignant

Benign4328
Malignant 26233

(b) Performance comparison

RandomCaoKhanProposed

AC0.81740.91130.63230.9514
PR0.82830.92920.55350.9407
RE0.79960.87730.53360.9550

(a) Confusion matrix

Class
Seborrheic dermatitisPsoriasisLichen planusChronic dermatitisPityriasis roseaPityriasis rubra pilaris

Seborrheic dermatitis61020490
Psoriasis01110000
Lichen planus0070000
Chronic dermatitis0105200
Pityriasis rosea000001
Pityriasis rubra pilaris0000019

(b) Performance comparison

RandomCaoKhanProposed

AC0.56830.59840.61750.8552
PR0.53180.55480.68410.7543
RE0.50280.53930.61650.8189

(a) Confusion matrix

Class
Not_recom Recommend Very_recom Priority Spec_prior

Not_recom1440013214841264
recommend00000
Very_recom00000
Priority14402196 1924 758
Spec_prior1440 00 858 2022

(b) Performance comparison

RandomCaoKhanProposed

AC0.33310.36730.28040.4156
PR0.29020.29780.23040.6494
RE0.25920.22730.20440.2569

(a) Confusion matrix

Class
RepublicanDemocrat

Republican16048
Democrat8219

(b) Performance comparison

RandomCaoKhanProposed

AC0.86030.86440.85060.8713
PR0.85540.85680.84840.8670
RE0.87320.87300.86720.8863

(a) Confusion matrix

Class
Win Nowin

Win15620
Nowin1277357

(b) Performance comparison

Random Cao Khan Proposed

AC 0.63900.7400 0.7040 0.6004
PR 0.5184 0.5449 0.53120.6092
RE 0.53940.5806 0.55400.7751

(a) Confusion matrix

Class
0 1 2 3 4

099 9 0 10
124104 22
2142530288
3209121
472122

(b) Performance comparison

Random Cao Khan Proposed

AC0.38950.30690.44220.4719
PR0.31590.27630.34130.3271
RE0.32190.26410.34670.3660

To better understand the performance of CD-Clustering, we revisit Table 2. There is a strong correlation between the accuracy metric and the gap between , avg.intra.dist and avg.inter.dist. If the ground-truth average intracluster and intercluster distances are far apart and is close to the former distance, we can get high accuracy (larger than 0.8). This is the cases of Soybean, Zoo, Breast-Cancer, Dermatology, and Vote. The two datasets with the lowest accuracy Nursery and Heart have smallest gaps between the ground-truth intracluster and intercluster distances. The three remaining datasets have medium accuracy despite the small distance gap. Out of the ten datasets, our CD-Clustering performs worst, that is, only comparable to or worse than the random -modes, on Mushroom and Chess. This is reflected in the ratio of top- to : 5,366/8,124 (Mushroom) and 2,389/3,196 (Chess). Also, is equal to 2 in these two datasets. These facts suggest that when and the intra/intercluster distance gap are both small, CD-Clustering must struggle harder for the top- communities.

6. Conclusion

Rather than using the -modes algorithm with heuristic initialization methods, we propose in this paper a novel clustering scheme CD-Clustering for categorical data. By applying the Louvain method, a widely used community detection technique, CD-Clustering can uncover the highly homogeneous groups of categorical data points using only the distance information. CD-Clustering builds the simple graph by limiting all pairwise Hamming distances by a threshold which is estimated simply using the number of clusters and the distance distribution. The evaluation against two -modes initialization techniques confirms the effectiveness of CD-Clustering. In future work, we plan to reduce the complexity of CD-Clustering for better scalability.

Notations

: Dataset with data points
:Set of categorical attributes
: modes of
:Number of clusters
:Hamming distance between and
:Hamming distance threshold
:Simple graph for with parameter .

Conflicts of Interest

The author declares that there are no conflicts of interest regarding the publication of this paper.

References

  1. A. K. Jain, “Data clustering: 50 years beyond K-means,” Pattern Recognition Letters, vol. 31, no. 8, pp. 651–666, 2010. View at: Publisher Site | Google Scholar
  2. S. P. Lloyd, “Least squares quantization in PCM,” Institute of Electrical and Electronics Engineers Transactions on Information Theory, vol. 28, no. 2, pp. 129–137, 1982. View at: Publisher Site | Google Scholar | MathSciNet
  3. Z. Huang, “Extensions to the k-means algorithm for clustering large data sets with categorical values,” Data Mining and Knowledge Discovery, vol. 2, no. 3, pp. 283–304, 1998. View at: Publisher Site | Google Scholar
  4. D. Arthur and S. Vassilvitskii, “k-means++: the advantages of careful seeding,” in Proceedings of the ACM-SIAM Symposium on Discrete Algorithms, pp. 1027–1035, 2007. View at: Google Scholar | MathSciNet
  5. B. Bahmani, B. Moseley, A. Vattani, R. Kumar, and S. Vassilvitskii, “Scalable κ-means++,” Proceedings of The VLDB Endowment, vol. 5, no. 7, pp. 622–633. View at: Google Scholar
  6. O. Bachem, M. Lucic, S. H. Hassani, and A. Krause, “Approximate K-Means++ in sublinear time,” in Proceedings of the 30th AAAI Conference on Artificial Intelligence, AAAI 2016, pp. 1459–1467, usa, February 2016. View at: Google Scholar
  7. L. Bai, J. Liang, C. Dang, and F. Cao, “A cluster centers initialization method for clustering categorical data,” Expert Systems with Applications, vol. 39, no. 9, pp. 8022–8029, 2012. View at: Publisher Site | Google Scholar
  8. F. Cao, J. Liang, and L. Bai, “A new initialization method for categorical data clustering,” Expert Systems with Applications, vol. 36, no. 7, pp. 10223–10228, 2009. View at: Publisher Site | Google Scholar
  9. S. S. Khan and A. Ahmad, “Cluster center initialization algorithm for K-modes clustering,” Expert Systems with Applications, vol. 40, no. 18, pp. 7444–7456, 2013. View at: Publisher Site | Google Scholar
  10. S. Wu, Q. Jiang, and J. Z. Huang, “A new initialization method for clustering categorical data,” in Proceedings of the Pacific-Asia Conference on Knowledge Discovery and Data Mining, pp. 972–980, Springer, 2007. View at: Google Scholar
  11. S. Fortunato, “Community detection in graphs,” Physics Reports, vol. 486, no. 3-5, pp. 75–174, 2010. View at: Publisher Site | Google Scholar
  12. V. D. Blondel, J. Guillaume, R. Lambiotte, and E. Lefebvre, “Fast unfolding of communities in large networks,” Journal of Statistical Mechanics: Theory and Experiment, vol. 2008, no. 10, Article ID P10008, 2008. View at: Publisher Site | Google Scholar
  13. F. Cao, J. Liang, D. Li, L. Bai, and C. Dang, “A dissimilarity measure for the k-modes clustering algorithm,” Knowledge-Based Systems, vol. 26, no. 9, pp. 120–127, 2012. View at: Publisher Site | Google Scholar
  14. Z. He, S. Deng, and X. Xu, “Improving K-Modes Algorithm Considering Frequencies of Attribute Values in Mode,” in Computational Intelligence and Security, vol. 3801 of Lecture Notes in Computer Science, pp. 157–162, Springer Berlin Heidelberg, Berlin, Heidelberg, 2005. View at: Publisher Site | Google Scholar
  15. M. K. Ng, M. J. Li, J. Z. Huang, and Z. He, “On the impact of dissimilarity measure in k-modes clustering algorithm,” IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 29, no. 3, pp. 503–507, 2007. View at: Publisher Site | Google Scholar
  16. H. Zhou, Y. Zhang, and Y. Liu, “A Global-Relationship Dissimilarity Measure for the,” Computational Intelligence and Neuroscience, vol. 2017, pp. 1–7, 2017. View at: Publisher Site | Google Scholar
  17. M. E. J. Newman and M. Girvan, “Finding and evaluating community structure in networks,” Physical Review E: Statistical, Nonlinear, and Soft Matter Physics, vol. 69, no. 2, Article ID 026113, pp. 1–26113, 2004. View at: Publisher Site | Google Scholar
  18. A. Clauset, M. E. J. Newman, and C. Moore, “Finding community structure in very large networks,” Physical Review E: Statistical, Nonlinear, and Soft Matter Physics, vol. 70, no. 6, Article ID 066111, 2004. View at: Publisher Site | Google Scholar
  19. A. Medus, G. Acuña, and C. O. Dorso, “Detection of community structures in networks via global optimization,” Physica A: Statistical Mechanics and its Applications, vol. 358, no. 2-4, pp. 593–604, 2005. View at: Publisher Site | Google Scholar
  20. M. E. J. Newman, “Finding community structure in networks using the eigenvectors of matrices,” Physical Review E: Statistical, Nonlinear, and Soft Matter Physics, vol. 74, no. 3, Article ID 036104, 2006. View at: Publisher Site | Google Scholar
  21. P. Pons and M. Latapy, “Computing communities in large networks using random walks,” Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics): Preface, vol. 3733, pp. 284–293, 2005. View at: Publisher Site | Google Scholar
  22. J. Reichardt and S. Bornholdt, “Statistical mechanics of community detection,” Physical Review E: Statistical, Nonlinear, and Soft Matter Physics, vol. 74, no. 1, Article ID 016110, 2006. View at: Publisher Site | Google Scholar
  23. U. N. Raghavan, R. Albert, and S. Kumara, “Near linear time algorithm to detect community structures in large-scale networks,” Physical Review E: Statistical, Nonlinear, and Soft Matter Physics, vol. 76, no. 3, Article ID 036106, 2007. View at: Publisher Site | Google Scholar
  24. M. Rosvall and C. T. Bergstrom, “Maps of random walks on complex networks reveal community structure,” Proceedings of the National Acadamy of Sciences of the United States of America, vol. 105, no. 4, pp. 1118–1123, 2008. View at: Publisher Site | Google Scholar
  25. B. J. Frey and D. Dueck, “Clustering by passing messages between data points,” American Association for the Advancement of Science: Science, vol. 315, no. 5814, pp. 972–976, 2007. View at: Publisher Site | Google Scholar | MathSciNet
  26. C. L. Blake and C. J. Merz, Uci repository of machine learning databases, vol. 55, University of california. Department of Information and Computer Science, Irvine, Calif, USA, 1998.
  27. Python implementations of the k-modes and k-prototypes clustering algorithms, for clustering categorical data, https://github.com/nicodv/kmodes.

Copyright © 2017 Huu Hiep Nguyen. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

1485 Views | 305 Downloads | 2 Citations
 PDF  Download Citation  Citation
 Download other formatsMore
 Order printed copiesOrder