Article

Corpus Characteristics-Based Method to Centroids Number Determination for Clustering Text Documents

Inti Sandino Magallon-Juan-Qui1★, Jose Francisco Martinez-Trinidad2, Darnes Vilarino-Ayala1, Jesus Ariel Carrasco-Ochoa2★ Corresponding author

  1. 1FCC Department, Benemerita Universidad Autonoma de Puebla, Avenida San Claudio, Blvrd 14 Sur, Ciudad Universitaria, Puebla, MEXICO.
  2. 2Department of Computer Science, National Institute for Astrophysics, Optics and Electronics, Luis Enrique Erro 1, Sta. Ma. Tonanzintla, Puebla, MEXICO.

CORRESPONDENCE

Inti Sandino Magallon-Juan-Qui

Inti Sandino Magallon-JuanQui, Faculty of Computer Science, Benemerita Universidad Autonoma de Puebla, Avenida San Claudio, Blvrd 14 Sur, Ciudad Universitaria, Puebla-72840, MEXICO.

inti.magallon@viep.com.mx

Received: 25-07-2024; Revised: 02-10-2024; Accepted: 12-11-2024.

Volume 14, Issue 1 · pp. 319–330 · PUBLISHED Jan-Apr 2025 · DOI: 10.5530/jscires.20251455

View on JSR original site ↗

ABSTRACT

Clustering is fundamental for categorizing and exploring information, particularly in written texts. Traditional clustering algorithms such as K-Means generate clusters in which each document is assigned to a cluster based on a centroid or representative of the cluster. Nevertheless, it is common to find situations where a single centroid is not enough to represent a cluster. To solve this problem, some variants of the K-Means algorithm have been introduced by considering more than one centroid per cluster. However, determining the number of centroids per cluster is a challenge; the user must employ trial and error to determine a good value, which is time-consuming. This paper proposes a solution to this problem for Improved-FPAC (Fast Partitional Clustering Algorithm, one of the most recent text document cluster algorithms) by introducing a method to compute the parameter l (number of centroids per cluster) based on the characteristics of the corpus. Based on our experiments on different public standard data sets, the method proposed in this paper, allows Improved-FPAC to obtain better clustering quality than the default value suggested by Improved-FPAC’s authors.

KEYWORDS

0% READ

FULL TEXT

INTRODUCTION

Generating large volumes of textual information by large companies or organizations requires the ability to organize this information for decision-making, research, or knowledge extraction; otherwise, storing this information does not make sense. Finding the necessary information from a large amount of data is a complex but necessary task for the daily activities of most institutions, companies and government entities. One of the widely used techniques to alleviate this problem is text document clustering. Text document clustering allows us to separate similar text documents into different clusters.

We can find several research efforts on text document clustering in the literature. Recently, extensive studies have been carried out on this topic where different methods have been reported in the literature.[1–14] In these studies, K-Means is one of the most commonly used algorithms for document clustering due to its ease of implementation, direct parallelization and relatively low computational cost.[15] However, K-Means presents some difficulties, such as the handling of the high dimensionality of vectors used for representing documents, which considerably increases the algorithm’s execution times; this has encouraged the development of new alternatives and variants of the algorithm. One of the recently developed algorithms makes use of the advantages of inverted lists for document retrieval, avoiding the comparison word by word of each document through a similarity function; this solution is presented in the FPAC algorithm,[16] improving the execution time considerably, without decreasing the quality of the clusters. To improve the cluster quality, Improved-FPAC[17] proposes defining multiple centroids for each cluster, which allows to increase the representativeness, without sacrificing too much the execution time.

In Bejos S, et al,[17] the authors experimented using different values for the number of centroids (parameter l) ranging from 5 to 30. They suggested using a fixed value l=10 for every corpus due to observing a decline in clustering quality beyond this threshold value in several corpora. However, we hypothesize that the value of this parameter should be defined according to the characteristics of the corpus to be clustered. For this reason, this paper proposes a corpus characteristics-based method for determining the number of centroids per cluster for Improved-FPAC. Our experimental analysis revealed a discernible correlation between the characteristics of a corpus (number of documents, number of words, number of classes or clusters) and the l value that produced the best clustering quality for this corpus. According to our experiments on public standard corpora, the method proposed in this paper allows Improved-FPAC to enhance its clustering quality results. The contribution of this paper is a method for determining the number of centroids per cluster (a parameter of the Improved-FPAC algorithm denoted as l) based on some of the characteristics of the corpus to cluster, such as the number of documents, number of words and number of classes or clusters. The proposed method facilitates the determination of a good value for l instead of adopting a uniform fixed value for all corpora, as suggested in Improved-FPAC. The proposed method avoids executing the Improved-FPAC algorithm several times to find a good value for the parameter l (the number of centroids) that provides good clustering results.

The rest of the paper is organized as follows. In the Second Section, we present the related work. In Section 3, our proposed method is introduced. The experimental study appears in Section 4. Finally, Section 5 discusses our conclusions and future work.

Currently, document clustering is widely studied and we can find several algorithms reported in the literature.[16–23] Among these algorithms, one that has reported good results is Improved-FPAC.[17] As commented in the Introduction Section, this algorithm is based on k-means and follows an information retrieval approach to build the clusters. Since in this paper we introduce a method for determining the number of centroids per cluster to be used in Improved-FPAC, in the rest of the section, we will review the main ideas of this algorithm.

Improved-FPAC consists of 6 steps:

  • Selection of the initial centroids (one per cluster).
  • Construction of the initial clusters as in FPAC.
  • Selection of multiple centroids per cluster.
  • Non-Centroids Assignment with multiple centroids per cluster.
  • Evaluation of the stop condition.

Selection of initial centroids

The process of selecting the initial centroids (k centroids) in the clustering algorithm involves the following steps: Initially, one centroid (c1) is randomly chosen from all the documents in the corpus being analyzed. To ensure diversity among the centroids, the next centroid (c2) is selected randomly from the documents that have not been included in the previously retrieved list of c1. This process is repeated for each subsequent centroid, where each new centroid (c3 and beyond) is selected randomly from the remaining documents that have not been part of the retrieved lists of the previously selected centroids (c1, c2, ...). The process continues until k initial cluster centroids have been chosen. This approach helps to achieve a diverse and representative set of initial centroids for the subsequent clustering process.

Construction of the initial clusters as in FPAC

To build the initial clusters, a non-centroid document d is assigned to a cluster by utilizing the initial centroids c1, ..., ck as queries to retrieve k ranked lists (r) of documents r1, ..., rk. Subsequently, if the document d is recovered solely in one ranked list, rj, it is included in the cluster corresponding to centroid cj. However, if the document d is retrieved in multiple ranked lists, it is assigned to the cluster where the normalized similarity score is maximized. If no centroid retrieves the document d, it is randomly assigned to any of the k clusters. This procedure facilitates the initial assignment of documents to clusters based on their similarity to the centroids, thus initializing the clustering process.

Selection of multiple centroids

After building the initial k clusters using Improved-FPAC, the algorithm proceeds to compute l centroids per cluster, where l is calculated whit Equation 2. To achieve this, each cluster Ci is divided into l disjoint subsets and these subsets are stored in l lists. Improved-FPAC iterates through the documents assigned to each cluster and distributes them into the disjoint subsets one by one until all documents within the cluster are distributed in the lists.

This partitioning allows each cluster to be covered by multiple subsets and within each subset; a centroid is computed as the average vector of the document vectors it contains. As a result, each cluster Ci obtains l centroids, providing a more granular representation of the cluster’s characteristics.

In summary, Improved-FPAC dynamically determines l centroids for each cluster Ci by dividing the cluster’s documents into l disjoint subsets and calculating centroids based on the average vectors of each subset. This approach contributes to the algorithm’s ability to achieve more refined clustering results.

Non-Centroids Assignment with multiple centroids

For assigning a non-centroid document d to a cluster, Improved-FPAC uses each of the l centroids as a query to retrieve a ranked list r for the cluster Ci. The normalized retrieval score is then computed for each centroid in each cluster Ci. Document d is assigned to the cluster Ci where the sum of the normalized retrieval scores is maximum. In the same way as in the construction of the initial clusters, the documents not retrieved by any centroid are randomly assigned to any of the k clusters.

Evaluation of the stop condition

The selection of multiple centroids and Non-Centroids Assignment with multiple centroids is repeated until the number of documents that change cluster between one iteration and another is not greater than a percentage defined as the stop condition; in Bejos S, et al.[17] 10% was used. Below, Figure 1 illustrates the diagram of Improved-FPAC.

Figure 1: Improved-FPAC whit multiple centroids.

Although in Bejos S, et al,[17] the authors report that Improved-FPAC with ten centroids for each cluster obtains good results in their experiments. However, determining the value of this parameter is generally not easy; it forces the user to rely on trial and error, which is impractical. For this reason, in the following section, a method to determine the number of centroids for Improved-FPAC from the characteristics of the corpus to be clustered is introduced.

Our method

This section introduces a method, based on the corpus characteristics, to calculate the number of centroids per cluster for the Improved-FPAC algorithm (parameter l). This was accomplished by analyzing the results of the Improved-FPAC algorithm using different values of l across various corpora utilized in the experiments conducted by Bejos S, et al.[17] The algorithm was executed starting with a value of l=10 (as recommended in Bejos S, et al),[17] Then incrementally increased by 10 in each execution until reaching l=200. Higher values were avoided as they did not significantly improve clustering quality. This behavior was consistent across all the used corpora. The F-Score metric was used to evaluate clustering quality for each value of l across the various corpora.

Table 1 shows the characteristics of each corpus used, i.e., number of documents (Docs), number of words (Words) and number of classes (Class). Additionally, the last column presents the number of centroids per cluster (l) that yielded the best F-Score results for the corpus among 20 executions conducted with values ranging from 10 to 200. We chose the F-Score measure because it is commonly used for evaluating information retrieval and document classification algorithms, which are the basis of Improved-FPAC.

Table 1: Best value of l and corpus characteristics.
CorpusDocsWordsClassl
R529,10018,9895240
R87,67417,150890
20 news groups18,24869,12020130
Webkb4,1687,6574160
Hitech2,30122,1196170
BBC News2,22520,7495180
Reviews4,06944,2875180
AGNews127,59941,3374190
Health Tweets62,71880,65316190
Webace203,90011,6062090

From the experiments performed with the Improved-FPAC algorithm, we observed that the more documents with different vocabulary in a cluster, the more centroids are required to represent the cluster. Note that the larger a cluster is, the more documents it will contain (and the number of terms will likely increase), thus more centroids will be required to represent the cluster.

On the other hand, the greater the number of clusters in which the documents are clustered, in general, the number of documents in each cluster decreases;[24] therefore, a smaller number of centroids will be required to represent the documents within a cluster.

From the above, we can infer that the number of documents and the vocabulary size (Words) are directly related to the number of centroids needed to represent the clusters. In contrast, the number of clusters (k) is inversely related to the number of centroids required to represent a cluster. Given that a larger k results in more clusters, each with fewer documents, fewer centroids will be needed to represent each cluster. Conversely, if k is small, there will be fewer clusters, but each will contain more documents, requiring more centroids to represent each cluster. Hence, according to the above discussion, we propose the following expression to relate these corpus characteristics:

By plotting the value of Expression 1 against the value of l that produced the best results from the twenty executions when ranging l from 10 to 200 for each corpus (y-axis), we obtain a set of points on the plane (one for each corpus); using these points, we can find a trend line to calculate the l value for the improved-FPAC algorithm for an unknown corpus from its characteristics. See Figure 2, where x is the normalized value of Expression 1 and y is the number of centroids per cluster (l) that produced the best results for the corpus, among all the executions performed by varying the value of l between 10 and 200. The graph in Figure 2 represents the trend line for all corpora (each corpus corresponds to a point on the graph). Then, a logarithmic trend line was adjusted using regression employing the residual sum of squares.[25]

Figure 2: Trend line of the values of expression 1 (x-axis) and the number of centroids per cluster yielding the highest quality resulting when varying the values of l (y-axis).

The following expression represents the trend line computed in Microsoft Excel:

This trend line will allow us to calculate the number of centroids per cluster to be used in the Improved-FPAC algorithm from the characteristics of the corpora.

As can be seen, in practice, applying our method requires evaluating the expression 7, 2 where x is as specified in expression 1. In Figure 3, we show the workflow when applying improved-FPAC using the proposed method to compute the number of centroids per cluster (parameter l).

Figure 3: Workflow diagram when applying improved FPAC using the proposed method.

It is necessary to mention that the value obtained from expression 2 must be truncated to an integer to define the value of l for each corpus. Additionally, if the value of l is less than 10, l is set to 10; if greater than 200, l is set to 200. In the next section, we show that applying our proposed method to determine a value for parameter l, which considers the corpus’s characteristics, produces good clustering results, as evidenced in Tables 4 and 5.

EXPERIMENTS AND RESULTS

This section will show the experiments to assess the proposed method to calculate the number of centroids per cluster for the Improved-FPAC algorithm.

For the experiments, 20 corpora were used. The characteristics of each corpus are shown in Table 3. The 10 Dataset Classification, German, IMDB Movie Reviews, Medical Dataset, Ohsumed, two corpora built from Reuters-21578 and Text Classification on Email corpora were downloaded from the Kaggle website.1 In addition, six corpora were generated from the ones used for developing our proposal and six were generated from the News Category corpus, also downloaded from the Kaggle website. Table 2 shows the details for building these corpora. The quality of the clusters was evaluated using Rand Index (RI), Recall, Precision, F-Score, Purity and Normalized Mutual Information (NMI), in the same way as in Bejos S, et al.[17] Below, we briefly explain the confusion matrix, which is fundamental for understanding RI, Recall and Precision. Subsequently, we provide detailed explanations of each of these measures.

Table 2: Description of how to build the generated corpora.
CorpusModification
News Category 4The classes of News Category were sorted alphabetically in ascending order and the last 37 classes in the corpus were removed.
News Category 5The classes of News Category were sorted alphabetically in ascending order and classes 20, 21, 22, and 23 were used.
News Category 8The classes of News Category were sorted alphabetically in ascending order and the last 33 classes in the corpus were removed.
News Category 12The classes of News Category were sorted alphabetically in ascending order and the last 19 classes in the corpus were removed.
News Category 16The classes of News Category were sorted alphabetically in ascending order and the last 15 classes in the corpus were removed.
News Category 20The classes of News Category were sorted alphabetically in ascending order and the last 11 classes in the corpus were removed.
03 AG NewsThe classes of AG News were sorted alphabetically in ascending order and the last class in the corpus was removed.
10 news groupsThe classes of 20 News Group were sorted alphabetically in ascending order and the last 10 classes in the corpus were removed.
BBC News Reviews 10All classes of the corpora BBCNews and Reviews were included in one corpus.
Health Tweets 8The classes of Health Tweets were sorted alphabetically in ascending order and the last 8 classes in the corpus were removed.
Reuters 8The classes money-fx, grain, crude, trade, interest, ship, and wheat were used from Reuters-21578.
Reuters 10The classes wheat, corn, dlr, money-supply, oilseed, sugar, coffee, gnp, gold, and veg-oil were used from Reuters-21578.
R26Classes of R52 were sorted alphabetically in ascending order and the last 26 classes in the corpus were removed.
R30Classes of R52 were sorted alphabetically in ascending order and the last 22 classes in the corpus were removed.
Table 3: Test corpora and corpus characteristics.
CorpusDocsWordsClass
03 AG News89,05933,8243
10 Dataset Classification1,00021,18710
10 News groups9,59541,49010
BBC News Reviews 106,29447,31910
Document Classification548514,6908
German10,273140,6249
Health Tweets829,14141,0578
IMDB Movie Reviews50,00070,5772
Medical dataset14,43824,5115
News Category413,30721,2024
News Category824,04529,1028
News Category1245,84640,09412
News Category1657,48845,48016
News Category2072,92451,42020
Ohsumed23,16628,06323
r268,57718,48726
r308,67918,55830
Reuters83,41030,6328
Reuters101,72318,09710
Text Classification on Email9,11980,3045

The confusion matrix provides a tabular representation of clustering outcomes regarding an already known clustering (ground truth) in terms of True Positives (TP), False Positives (FP), True Negatives (TN) and False Negatives (FN).

True Positives (TP)

This is the number of pairs of documents that the clustering algorithm puts together in the same cluster and they are together in a cluster in the already known clustering.

False Positives (FP)

This is the number of pairs of documents that the clustering algorithms puts together in the same cluster and they are in different clusters in the already known clustering.

True Negatives (TN)

This is the number of pairs of documents that the clustering algorithm puts in different clusters and they are in distinct clusters in the already known clustering.

False Negatives (FN)

This is the number of pairs of documents that the clustering algorithm puts in different clusters and they are in the same cluster in the already known clustering.

Next, we explain each measure used to evaluate the experiments:

RI

Rand Index measures the similarity between two clusterings by considering all pairs of documents and calculating the number that are either in the same or in different clusters in both clusterings. It provides a score between 0 and 1, where higher values indicate better agreement between the clusterings, considering the confusion matrix is defined as follows:

Recall

Recall measures how well a clustering algorithm identifies objects that should be together in a cluster. It is the ratio of true positives to the sum of true positives and false negatives. It is defined as follows:

Precision

Precision measures how accurate a clustering algorithm is when it puts instances together in a cluster. It is the ratio of true positives to the sum of true and false positives. It is defined as follows:

F-Score (F1-Score)

It is defined as the harmonic mean of the clustering algorithm’s precision and recall and is defined as follows:

Purity

Purity assesses how well the clusters built by a clustering algorithm correspond to known cluster in the ground truth. It calculates the proportion of documents in a cluster that belong to the most common class in that cluster. It Is defined as follows:

Where:

- N is the total number of documents in the dataset.

-Ci is the predicted cluster to which the i-th document belongs.

-Tj is the true or actual cluster to which the j-th document belongs in the ground truth.

-Intersection (Ci, Tj) represents the size of the intersection between Ci and Tj.

NMI

NMI quantifies the amount of shared information between two clusterings, considering both agreement and randomness. NMI provides a normalized score ranging from 0 to 1, where higher values indicate better agreement between the clusterings and it is defined as follows:

Where:

- MI stands for Mutual Information between the predicted clusters C and the true clusters T .

- H (C) represents the Entropy of the predicted clusters C.

- H (T ) represents the Entropy of the true clusters T .

Concerning the parameter k and the termination criterion within Improved-FPAC, we established that the count of clusters to be constructed (parameter k) matches the count of classes present in each corpus. The maximum number of iterations was set to 10 because, in our experiments, the Improved-FPAC algorithm usually stops before reaching this number of iterations;[17] we can also observe this fact in the last column of Tables 4, 5 and 6, which shows the maximum number of iterations (Max Iter) performed for each corpus and each method. In our experiments, the maximum value of 10 was reached only in two of the corpora (r26 and r30). The stopping criterion (convergence) was defined as having less than 10% of documents reassigned to different clusters between two iterations.

Table 4: Comparison of results obtained using our method, the proposed value in Bejos S, et al.[17] and Scalable K-Means. The statistically better values were marked with an asterisk (p<0.01) and the best averages were highlighted in bold.
lRIRecallPrecisionF-ScorePurityNMIMax Iter
CorpusAVGSTDAVGSTDAVGSTDAVGSTDAVGSTDAVGSTD
03 AG News
Our Method2000.7896*0.07860.6936*0.11070.6827*0.11780.688*0.11430.7809*0.11860.5006*0.13175
Improved-FPAC100.61650.02330.4330.03570.4260.03460.42950.0350.53710.04180.13150.04845
Scalable K-Means-0.56070.00570.34520.01050.34240.0090.34380.00970.38840.03470.01240.01210
Varying l2000.79370.03990.6990.05760.68880.0590.69380.05820.7820.06370.50830.08195
10 Dataset Classification
Our Method1190.8936*0.01610.5519*0.07560.4701*0.07110.5072*0.0710.604*0.08210.5712*0.06235
Improved-FPAC100.88820.0150.4820.08430.44060.07120.46030.07720.58270.07020.51270.07755
Scalable K-Means-0.84720.00930.28560.04320.25680.03990.27030.04120.41980.05070.27670.05462
Varying l600.91670.01780.62850.09990.57240.08260.59890.09020.68840.0850.66180.0875
10newsgroups
Our Method1600.8932*0.00550.4868*0.03020.4683*0.02650.4773*0.02770.5985*0.02820.5106*0.02226
Improved-FPAC100.86460.00820.35160.03850.33380.0380.34250.03820.46150.03040.3640.03436
Scalable K-Means-0.82060.00560.16190.01660.14560.01580.15330.0160.25140.02690.09040.02242
Varying l2000.89330.00710.48720.03420.46890.03280.47780.03330.59520.02290.50990.02496
BBC News Reviews 10
Our Method1640.8892*0.01310.5202*0.0430.6156*0.06350.5616*0.03630.7382*0.04120.6788*0.02824
Improved-FPAC100.87760.0090.45110.03040.56470.0420.50110.03180.68510.02980.6140.02527
Scalable K-Means-0.83530.01530.3140.03940.37840.04990.3420.03950.5280.05540.41040.04082
Varying l1800.8890.01070.52040.02660.61480.05080.56120.03140.7350.03570.67830.02184
Document Clasification
Our Method1210.72270.01660.31150.03460.79010.04190.44650.04190.8035*0.01720.4703*0.0286
Improved-FPAC100.74630.0360.4152*0.09070.770.05940.5366*0.08910.74550.02590.36630.04535
Scalable K-Means-0.66060.01520.19470.0210.5870.06410.29230.03080.69130.01290.23210.02982
Varying l100.74630.03140.41520.07860.770.04870.53660.07960.74550.02550.36630.0337
German
Our Method2000.85*0.00890.3793*0.03220.405*0.03640.3916*0.03370.5333*0.04670.3646*0.02825
Improved-FPAC100.83450.00720.32060.02680.34060.02740.33010.02590.46670.02520.27960.02435
Scalable K-Means-0.79910.00540.1810.01460.19260.01640.18660.01510.31340.02740.10790.02212
Varying l2000.85060.00770.37950.02980.4070.030.39270.02840.53640.03030.36680.02215
Health Tweets 8
Our Method1830.831*0.01060.3874*0.03840.4455*0.04030.4143*0.03880.5851*0.03380.3831*0.03895
Improved-FPAC100.80390.00640.29220.02440.34190.0250.31510.02470.47690.02280.23450.02245
Scalable K-Means-0.78690.0180.25520.04310.28830.05570.27050.04820.43590.05840.18660.06492
Varying l2000.83330.00790.39410.03040.4540.03070.42190.03050.5960.01840.39490.02275
Table 5: Comparison of results obtained using our method, the proposed value in Bejos S, et al.[17] and Scalable K-Means. The statistically better values were marked with an asterisk (p<0.01) and the best averages were highlighted in bold.
lRIRecallPrecisionF-ScorePurityNMIMax Iter
CorpusAVGSTDAVGSTDAVGSTDAVGSTDAVGSTDAVGSTD
IMDB Movie Reviews
Our Method2000.5276*0.01690.5452*0.01430.5267*0.01660.5358*0.01520.6117*0.03820.0422*0.02574
Improved-FPAC100.5050.00330.52770.01430.50480.00310.51590.00750.54630.020.00780.00514
Scalable K-Means-0.50590.00560.50610.00560.50590.00560.5060.00560.54740.02790.00850.00812
Varying l2000.52790.00570.54510.01380.52710.00550.53590.00770.61240.02520.04260.00864
Medical Dataset
Our Method1780.6762*0.00640.2404*0.010.2741*0.01350.2562*0.01150.3824*0.0190.0686*0.02134
Improved-FPAC100.67450.00750.23660.01560.26970.01790.25210.01660.37590.02460.05980.02484
Scalable K-Means-0.66360.0020.21190.00440.24220.00460.22610.00440.34180.00950.0160.00622
Varying l600.67780.00760.24230.01440.27720.01760.25860.01580.38420.02540.07450.02475
News Category 4
Our Method1830.6716*0.01980.39060.03040.5178*0.03920.4453*0.03420.6347*0.04270.2073*0.03926
Improved-FPAC100.61440.01710.30090.02680.4040.03440.34490.03010.53870.03610.06850.03135
Scalable K-Means-0.58270.00260.25790.00560.34280.00330.29430.00420.45170.00970.00750.00442
Varying l1400.6740.01680.39330.02610.52260.03330.44880.02920.64830.03480.22070.03117
News Category 8
Our Method1680.797*0.00860.2953*0.03030.3881*0.03430.3354*0.03230.5157*0.02630.2538*0.02466
Improved-FPAC100.7760.00680.22470.02430.30330.02890.25820.02650.44580.03270.15410.02376
Scalable K-Means-0.74290.00260.140.00510.18390.00450.15890.00460.27290.01380.01750.00772
Varying l600.79860.00720.29790.02630.39350.02960.3390.0280.52580.03310.26120.02446
News Category 12
Our Method1700.7938*0.00220.1646*0.0060.334*0.0120.2206*0.00780.4868*0.02040.2169*0.00916
Improved-FPAC100.78580.00220.13550.00740.28240.01380.18320.00970.44250.0180.14630.01746
Scalable K-Means-0.76480.00170.09940.00360.1890.0040.13030.00370.35130.00270.01910.00482
Varying l1200.79450.00310.16610.01020.3380.0190.22280.01320.49370.02370.22290.01916
News Category 16
Our Method1630.8521*0.00220.1837*0.01030.3494*0.01710.2408*0.01280.4851*0.01280.2648*0.01176
Improved-FPAC100.84620.00210.15370.010.30010.01720.20330.01270.44060.01790.20470.01486
Scalable K-Means-0.81830.00260.08290.00410.1410.00310.10440.00370.2870.00340.02350.0032
Varying l1200.85290.00210.18650.010.3550.0170.24450.01260.49130.01750.27140.01427
News Category 20
Our Method1610.8822*0.00250.1599*0.01380.276*0.02330.2025*0.01730.4152*0.02210.2358*0.01546
Improved-FPAC100.880.00150.13590.00970.24470.0160.17470.01210.38520.0120.20330.01327
Scalable K-Means-0.85270.00460.07570.00440.10450.00430.08770.00290.22640.00480.02570.00542
Varying l500.88460.00210.16650.01230.29360.02070.21250.01540.43460.01650.25770.01288
Table 6: Comparison of results obtained using our method, the proposed value in Bejos S, et al.[17] and Scalable K-Means. The statistically better values were marked with an asterisk (p<0.01) and the best averages were highlighted in bold.
lRIRecallPrecisionF-ScorePurityNMIMax Iter
CorpusAVGSTDAVGSTDAVGSTDAVGSTDAVGSTDAVGSTD
ohsumed
Our Method1100.88740.00060.0792*0.00350.1340.00470.09960.0040.25650.00540.1164*0.00518
Improved-FPAC100.88770.00070.07570.00560.13030.00820.09570.00660.2420.00860.10510.00825
Scalable K-Means-0.88120.00130.05910.00160.0940.00280.07260.00180.19770.00620.03910.00412
Varying l400.88770.00080.07980.0050.13570.00750.10050.0060.25440.00740.11910.007210
r26
Our Method730.75190.01350.1620.04540.83080.03890.26940.06230.8027*0.01340.486*0.015110
Improved-FPAC100.7606*0.01780.2087*0.05940.80450.05730.329*0.07860.75560.01060.43590.018910
Scalable K-Means-0.72150.00680.10570.01360.5650.06140.17790.02170.66790.02010.28220.01722
Varying l100.76060.01120.20870.03920.80450.02970.3290.05250.75560.01150.43590.012610
r30
Our Method660.75290.0070.14280.02330.82690.03480.24320.03470.7986*0.01460.4853*0.014510
Improved-FPAC100.7741*0.01810.2295*0.05970.84290.06310.3586*0.08010.76330.01820.45680.021910
Scalable K-Means-0.72470.00610.10140.02010.53480.05630.16980.02840.65170.01810.27660.01922
Varying l100.77410.01030.22950.03560.84290.0320.35860.04930.76330.01570.45680.011310
Reuters8
Our Method1520.8269*0.01530.3751*0.05460.4344*0.05790.4026*0.05620.5599*0.05920.4179*0.06385
Improved-FPAC100.78660.01370.26870.02750.29730.03880.28210.0320.42850.04030.22230.04484
Scalable K-Means-0.7750.01040.21680.02230.24750.02890.2310.02470.37810.04160.1460.03512
Varying l2000.83310.01380.39140.03370.45680.04410.42150.0380.57910.04680.43910.05115
Reuters10
Our Method1120.861*0.00830.3432*0.04060.3501*0.03990.3466*0.03990.475*0.0450.4044*0.03785
Improved-FPAC100.84140.00760.260.03350.26120.0340.26050.03360.38550.03310.27620.04134
Scalable K-Means-0.82570.00570.22150.03740.20730.02860.2140.03240.32590.03080.18960.03742
Varying l1400.86230.00680.36060.03460.35890.0330.35960.03370.48680.030.41820.04017
Text Clasification On EMail
Our Method2000.6932*0.01730.35*0.0350.5443*0.03960.4259*0.03730.6435*0.03220.2773*0.04235
Improved-FPAC100.6410.01040.26170.01850.4180.0260.32190.02170.5530.04150.11910.02214
Scalable K-Means-0.61450.00460.22570.00490.35550.00940.27610.0060.48620.0160.03620.01122
Varying l1000.69420.01560.35420.02750.54650.03650.42970.0310.6460.04250.28040.03394

As information retrieval system for Improved-FPAC, we used the Apache Lucene implementation version 7.3.2 A Red Hat Enterprise Linux Server Release 7.5 (Maipo) with 160 processors and 128 GB of memory was used for running all our experiments. Our method was applied to each corpus to determine the value of the parameter l. Once the value of l was determined, the Improved-FPAC algorithm was executed with this value and the quality of the resulting clustering was evaluated. Due to the randomness of Improved-FPAC in steps 1 and 4, the algorithm was executed ten times in each corpus and the average quality of the 10 executions is reported. On the other hand, the Improved-FPAC algorithm was applied ten times in each corpus using l=10 as the number of centroids as suggested in.[17] Additionally, in the same way as in,[17] we included the results obtained by Scalable K-means in our experiments. Finally, to appreciate the effectiveness of our proposal, we also performed a kind of semi-exhaustive trial and error evaluation of the Improved FPAC algorithm, which was executed (also ten times) by varying the value of l from 10 to 200 with increments of 10 and the best result is reported.

The results of the experiments are shown in detail in Tables 4-6. These tables are divided into separate blocks; each block corresponds to a corpus and has five rows; in the first row, the name of the corpus is found and in the remaining four rows, the quality of the clustering results obtained by Improved-FPAC are shown as follows: the second row shows, the results obtained by applying our method to determine the value of the parameter l; the third row shows the results obtained by using l=10; the fourth row shows the best result by varying the value of l from 10 to 200; and the fifth row shows the quality results obtained for Scalable K-Means. The first column displays the name of the clustering method used and the second column shows the number of centroids per cluster for the respective method. Columns three through fourteen present the average and standard deviation results for RI, Recall, Precision, F-Score, Purity and NMI. The last column of these tables shows the maximum number of iterations in all repetitions. In the results, the best outcome achieved for each method in each of the corpora is highlighted in bold-text as it can be seen in Tables 4-6, the standard deviation is very small in all cases. In Figure 4, we can see the summarized results for the three compared methods using the F-Score metric. The x-axis displays the corpora used in the experiments, while the y-axis shows the F-Score value obtained for each method and corpus.

Figure 4: F-Score results for each corpus for the compared methods.

In Figure 4, we can see the summarized results for the three compared methods using the F-Score metric; the x-axis displays the corpora used in the experiments, while the y-axis shows the F-Score value obtained for each method and corpus. From this figure, we can also see that using our proposal for calculating the number of centroids per cluster allows obtaining the best results in most cases. According to our experiments, in 16 of 20 corpora, the quality of the clustering obtained by the Improved-FPAC algorithm with the value of l calculated using our method yields better results than the value of l recommended in Bejos S, et al.[17] These results are obtained regardless of the evaluation measure used; see the second and third rows in each block in Tables 4, 5 and 6. To validate these results, we applied the statistical Wilcoxon signed-rank test with p<0.01, which showed that our proposed method is statistically better (see entries marked with an asterisk in Tables 4-6) than the method proposed by Bejos S, et al,[17] on these 16 datasets. Although the quality of the clustering obtained by the Improved-FPAC algorithm using the value of l calculated by our method did not coincide in all cases with the best clustering computed by Improved-FPAC varying l between 10 and 200, it was close to the best option. Our experiments show that Scalable K-means obtained the worst quality results in all the corpora.

CONCLUSION AND FUTURE WORK

This work introduces a method to compute the number of centroids per cluster (parameter l) for the Improved-FPAC algorithm. The proposed method considers the characteristics of the corpus (number of documents, vocabulary and number of classes) to determine the value for parameter l. To calculate the value of l, some corpora widely used in the literature were used to create an equation from a trend line obtained from the relationship between the best quality value obtained by varying the number of centroids from 10 to 200 and the characteristics of each corpus.

In our experiments, we confirmed a relationship between the characteristics of the corpus and the value of the parameter l that should be used in the Improved-FPAC algorithm to obtain better-quality results. In most of the evaluated corpora, the quality obtained with our method exceeds that obtained by using the fixed value suggested.[17] Additionally, our proposal allows obtaining quality values close to the best quality found by varying l. However, using our method, it is not necessary to run the algorithm several times changing the number of centroids to find the option with the best quality result, which is not an option in practice.

In future work, we will modify Improved-FPAC to allow dynamic values of l. Starting from the value defined by our current proposal and dynamically increasing or decreasing it according to the number of documents and vocabulary size of each cluster and the quality results obtained in each iteration of the algorithm.

FPAC uses each cluster center as a query to retrieve a list of documents, assigned to that cluster without requiring distance calculation. However, as the number of centroids increases, in Improved-FPAC, the possibility of overlap and the number of distance calculations also increases. To avoid this, it is necessary to improve the query used in the cluster computation to remove those terms already included in a centroid, reducing overlap and potentially improving the algorithm’s performance.

REFERENCES

As published

Showing references and in-text citations exactly as published.

  1. 1.Abualigah, L; Gandomi, AH; Elaziz, MA; Hussien, AG; Khasawneh, AM; Alshinwan, M et al. Nature-inspired optimization algorithms for text document clustering—a comprehensive analysis. Algorithms. 2020;13(12):345. https://doi.org/10.3390/a13120345DOIGOOGLE SCHOLAR
  2. 2.Agarwal, N; Sikka, G; Awasthi, LK.. A systematic literature review on web service clustering approaches to enhance service discovery, selection and recommendation. Comput Sci Rev. 2022;45. https://doi.org/10.1016/j.cosrev.2022.100498DOIGOOGLE SCHOLAR
  3. 3.Alghamdi, HM; Selamat, A.. Arabic web page clustering: a review. J King Saud Univ Comput Inf Sci. 2019;31(1):1–14. https://doi.org/10.1016/j.jksuci.2017.06.002DOIGOOGLE SCHOLAR
  4. 4.Cozzolino, I; Ferraro, MB.. Document clustering. WIREs Computational Stats. 2022;14(6):e1588. https://doi.org/10.1002/wics.1588DOIGOOGLE SCHOLAR
  5. 5.Dobrakowski, AG; Mykowiecka, A; Marciniak, M; Jaworski, W; Biecek, P.. Interpretable segmentation of medical free-text records based on word embeddings. J Intell Inf Syst. 2021;57(3):447–65. https://doi.org/10.1007/s10844-021-00659-4DOIGOOGLE SCHOLAR
  6. 6.Eligüzel, N; Çetinkaya, Ç; Dereli, T.. A novel approach for text categorization by applying hybrid genetic bat algorithm through feature extraction and feature selection methods. Expert Syst Appl. 2022;202:117433. https://doi.org/10.1016/j.eswa.2022.117433DOIGOOGLE SCHOLAR
  7. 7.Inje, B; Nagwanshi, KK; Rambola, RK.. An efficient document information retrieval using hybrid global search optimization algorithm with density based clustering technique. Clust Comput. 2023;1–17.GOOGLE SCHOLAR
  8. 8.Kim, H; Kim, HK; Cho, S.. Improving spherical k-means for document clustering: fast initialization, sparse centroid projection and efficient cluster labeling. Expert Syst Appl. 2020;150:113288. https://doi.org/10.1016/j.eswa.2020.113288DOIGOOGLE SCHOLAR
  9. 9.Malik, F; Khan, S; Rizwan, A; Atteia, G; Samee, NA.. A novel hybrid clustering approach based on black hole algorithm for document clustering. IEEE Access. 2022;10:97310–26. https://doi.org/10.1109/ACCESS.2022.3202017DOIGOOGLE SCHOLAR
  10. 10.Pandey, KK; Shukla, D.. Ndpd: an improved initial centroid method of pertitional clustering for big data mining. J Adv Manag Res. 2023;20(1):1–34. https://doi.org/10.1108/JAMR-07-2021-0242DOIGOOGLE SCHOLAR
  11. 11.Ponnusamy, M; Bedi, P; Suresh, T; Alagarsamy, A; Manikandan, R; Yuvaraj, N.. Design and analysis of text document clustering using salp swarm algorithm. J Supercomput. 2022;78(14):16197–213. https://doi.org/10.1007/s11227-022-04525-0DOIGOOGLE SCHOLAR
  12. 12.Song, W; Qiao, Y; Park, SC; Qian, X.. A hybrid evolutionary computation approach with its application for optimizing text document clustering. Expert Systems with Applications. 42(5):2517–24. https://doi.org/10.1016/j.eswa.2014.11.003DOIGOOGLE SCHOLAR
  13. 13.V(K). & S, S.. Developing a conceptual framework for short text categorization using hybrid cnn-LSTM based caledonian crow optimization. Expert Syst Appl. 2023;212:118517.GOOGLE SCHOLAR
  14. 14.Yong, KS; Liew, JS.. The more. J Intell Inf Syst. 2023;1–21.GOOGLE SCHOLAR
  15. 15.Fahad, SA; Alam, MM.. A modified k-means algorithm for big data clustering. Int J Sci Eng Comput Technol. 2016;6:129.GOOGLE SCHOLAR
  16. 16.Ganguly, D.. A fast partitional clustering algorithm based on nearest neighbours heuristics. Pattern Recognit Lett. 2018;112:198–204. https://doi.org/10.1016/j.patrec.2018.07.017DOIGOOGLE SCHOLAR
  17. 17.Bejos, S; Feliciano-Avelino, I; Martínez-Trinidad, JF; Carrasco-Ochoa, JA.. Improved fast partitional clustering algorithm for text clustering. J Intell Fuzzy Syst. 2020;39(2):2137–45. https://doi.org/10.3233/JIFS-179879DOIGOOGLE SCHOLAR
  18. 18.Abasi, AK et al. A hybrid salp swarm algorithm with β-hill climbing algorithm for text documents clustering. Evol Data Clustering Algor Appl. 2021;129.GOOGLE SCHOLAR
  19. 19.Abualigah, LM; Khader, AT; Hanandeh, ES.. A combination of objective functions and hybrid krill herd algorithm for text document clustering analysis. Eng Appl Artif Intell. 2018;73:111–25. https://doi.org/10.1016/j.engappai.2018.05.003DOIGOOGLE SCHOLAR
  20. 20.Akter, R; Chung, Y.. An improved genetic algorithm for document clustering on the cloud. Int J Cloud Appl Comput. 2018;8(4):20–8. https://doi.org/10.4018/IJCAC.2018100102DOIGOOGLE SCHOLAR
  21. 21.Bezdan, T; Stoean, C; Naamany, AA; Bacanin, N; Rashid, TA; Zivkovic, M et al. Hybrid fruit-fly optimization algorithm with k-means for text document clustering. Mathematics. 2021;9(16):1929. https://doi.org/10.3390/math9161929DOIGOOGLE SCHOLAR
  22. 22.Janani, R; Vijayarani, S.. Text document clustering using spectral clustering algorithm with particle swarm optimization. Expert Syst Appl. 2019;134:192–200. https://doi.org/10.1016/j.eswa.2019.05.030DOIGOOGLE SCHOLAR
  23. 23.Thirumoorthy, K; Muneeswaran, K.. A hybrid approach for text document clustering using jaya optimization algorithm. Expert Syst Appl. 2021;178:115040. https://doi.org/10.1016/j.eswa.2021.115040DOIGOOGLE SCHOLAR
  24. 24.Yuan, M; Zobel, J; Lin, P.. Measurement of clustering effectiveness for document collections. Inf Retrieval J. 2022;25(3):239–68. https://doi.org/10.1007/s10791-021-09401-8DOIGOOGLE SCHOLAR
  25. 25.Morgan, JA; Tatar, JF. Calculation of the residual sum of squares for all possible regressions. Technometrics. 1972;14(2):317–25. https://doi.org/10.1080/00401706.1972.10488918DOIGOOGLE SCHOLAR

Cite this article

SELECT FORMAT

Magallon-Juan-Qui, I. S., Martinez-Trinidad, J. F., Vilarino-Ayala, D., & Carrasco-Ochoa, J. A. (2025). Corpus Characteristics-Based Method to Centroids Number Determination for Clustering Text Documents. Journal of Scientometric Research, 14(1), 319–330. https://doi.org/10.5530/jscires.20251455