Introduction

Clustering is an unsupervised learning task that is essential in many applications. The main goal of clustering is to find the similarities between every group of data to find common relationships between them. It is widely used in different domains such as medical diagnosis [53], ransomeware detection [54], customer segmentation [49], image processing [33], dental radiography [48], and pattern recognition [34].

Swarm intelligence (SI) and evolutionary algorithms (EA) as nature-inspired metaheuristic algorithms are commonly utilized for performing partitional clustering tasks. They are proven to be efficient for multiple scientific and engineering domains [43]. The main advantage of using these algorithms in clustering is the ability to explore and search for better grouping of data to achieve high quality clustering results [43]. In addition, they have reasonable running time [63], they can avoid falling in local optima [47], and they can work with noisy data [25].

Metaheuristic algorithms use predefined objective function to lead the solution toward the optimal one [50]. The objective function directly affects the quality of the results [55]. Thus, considering the best objective function is very important, and is not an easy task.

Nature-inspired algorithms include well-regarded optimization algorithms such as Genetic algorithm (GA) [22], Evolution strategy (ES) [9], Particle swarm optimization (PSO) [27], and Ant colony optimization (ACO) [31]. While noticeable recent nature-inspired algorithms include Cuckoo Search (CS) [73], Grey Wolf Optimizer (GWO) [7, 42], Multi-verse optimizer (MVO) [8, 41, 63], Moth-flame optimization (MFO) [38], Whale Optimization Algorithm (WOA) [40], Bat Algorithm (BAT) [72], Firefly Algorithm (FFA) [71], and many others [2, 4,5,6].

EvoCluster is an open-source framework for partitional clustering based on using nature-inspired metaheuristic optimizers. It provides a set of nature-inspired optimizers for performing the partitional clustering task to facilitate using these algorithms by researchers and practitioners, It provides a wide set of objective functions that are customized for the partitional clustering task. It also facilitates the evaluation process of clustering by including many well-known evaluation measures for clustering and providing a set of well-known data sets which are widely used for performing experiments in clustering.

In this paper, we extend the current implementation of EvoCluster to include the following:

  • Different distance measures for the objective function from the well-known scipy.spatial.distance package [66].

  • A user option to run the framework on either supervised or unsupervised datasets. Accordingly, different presentations of the results are held.

  • Different ways to specify the k value; The user can determine a specific k value for each dataset, or choose the automatic option. The automatic option includes automatically deriving the k value from the true labels, or applying different detection techniques such as the Elbow method to automatically predict the k value for each dataset.

The remainder of this paper is organized as follows: Sect. 2 presents the latest evolutionary and clustering frameworks and libraries in the literature. Section 3 describes in detail the components and functionalities of the framework including the extended features. Sect. 4 displays the design of population and the framework components. Section 5 shows some visual representation of some results and plots generated from the framework. Section 6 concludes the work and gives further other possible extensions to the framework.

Related Work

Many frameworks and libraries can be found in the literature to perform the clustering tasks. Some popular examples are Weka [19], Elki [1] , and scikit-learn [45]. Some other frameworks that are specific to clustering are clusterNOR [37] and ClustEval [70]. clusterNOR is a parallel framework which includes nine clustering algorithms, while ClustEval is a recent framework that includes around twenty well-known algorithms and fourteen evaluation measures. Other frameworks are specific to certain domains: TimeClust [35] is a clustering tool for gene expression time series having four clustering algorithms. A recent framework was developed in [57] named clusterExperiment for clustering single-cell RNA-Seq data. These clustering frameworks and libraries include the basic and traditional clustering algorithms and most of them do not include nature-inspired metaheuristic optimizers.

Since nature-inspired metaheuristic algorithms are commonly used in different applications, some general-purpose frameworks and libraries were developed to facilitate their use. EvoloPy [16] is one of the recent open-source Python frameworks that includes well-known and recent nature-inspired optimizing algorithms. It aims at facilitating the use of the optimization algorithms by researchers and practitioners for different problems. The framework is scalable and can be customized to include additional algorithms and benchmark functions as well as modifications to existing implementation. It also provides numerical and graphical representation of the results. Evolopy-FS [28] is another version of Evolopy for feature selection.

On the other hand, NiaPy [67] is a Python microframework for building nature-inspired algorithms. Other popular frameworks include DEAP [18], ECJ [69], EO [26], HeuristicLab [68], jMetal [15], and ParadisEO [10]. Some frameworks are specific to certain domains: GEATbx [20] is a framework in MATLAB having many variants of the Genetic Algorithms and Genetic Programming. GAlib [36] is a C++ library of genetic algorithm tools and operators for parallel environments. These frameworks are used for optimizing general problems which do not include clustering.

Since the clustering task can be approached by optimizing the centroids for the clusters according to a predefined objective function, which needs special implementation, frameworks and libraries can be implemented for this purpose. To the best of our knowledge, we found only one framework for clustering with evolutionary algorithms which is LEAC [58]. LEAC is implemented using C++ which includes 23 Evolutionary Algorithms for partitional clustering. However, most practitioners use other languages which have more libraries and packages than C++ language. In addition, the algorithms used in LEAC are only different variations of the evolutionary operators for fixed and variable k-clusters and do not include other algorithms. Thus, there is a need for a framework of nature-inspired metaheuristic clustering optimizers which is not specific to the evolutionary algorithms.

In this sense, EvoCluster [51] is a flexible framework that includes several nature-inspired metaheuristic optimizers for performing the clustering task. This framework allows users’ customizations of the clustering algorithms, the objective functions, and the evaluation measures. EvoCluster is an extension to the aforementioned EvoloPy framework in which the algorithms are customized for the partitional clustering task. It also considers multiple objective functions for enhancing the performance of the population at each iteration. Evaluation measures are also implemented for evaluating the clustering results. To the best of our knowledge, EvoCluster framework is the first framework in Python language for clustering data using the selected metaheuristic optimizers. It is implemented efficiently considering the computation time and the quality of results.

In addition, the effect of the selected distance measure and the technique used for specifying the number of clusters in the framework should be investigated. Although the effect of different distance measures was discussed and compared in several works, some were specific to a certain domain or application [17, 23, 44], others were based on a specific algorithm [30, 52], and other were examined on a specific type of datasets such as the ones with high dimensionality [44, 52]. On the other hand, specifying the k value has been discussed in several works [29, 32, 64] which include the Elbow, gap analysis, Silhouette coefficient, Calinski-Harabasz (CH), Davies-Bouldin (DB), and Bayesian Information Criterion score (BIC) techniques. Therefore, due to the importance of these parameters, both are covered in the extended implementation of the framework.

Under this view, extending useful frameworks such as EvoCluster with additional features gives researchers and practitioners more possibilities and opportunities while using the framework. Thus, we are extending the current implementation of EvoCluster to include new different distance measures for the objective function, different ways of specifying the k value, and a user option to consider either supervised or unsupervised datasets.

Framework Overview

EvoCluster includes the most well-regarded nature-inspired metaheuristic optimizers that are adopted for performing the partitional clustering task with a very easy and useful interface. The framework is constructed with six main components which are described in the following sections:

The Optimizer

It serves as the main interface of the framework. Users can select the set of optimizers, data sets, and objective functions according to their preference for running the experiments. They can also specify the main parameters that are common for most optimizers which are the number of iterations and the population size. The number of runs can also be determined through this interface. In addition, users select the evaluation measures to evaluate the predicted labels generated from the framework.

The optimizer is further extended to include different distance measures from the well-known scipy.spatial.distance package [66]. It includes braycurtis, canberra, chebyshev, cityblock, correlation, cosine, dice, euclidean, hamming, jaccard, jensenshannon, kulsinski, mahalanobis, matching, minkowski, rogerstanimoto, russellrao, seuclidean, sokalmichener, sokalsneath, sqeuclidean, and yule distance measures [66].

The user is also allowed to run the framework on datasets that are either unsupervised or supervised according to the existence of the true labels in the datasets. In the case of unsupervised datasets, results files do not include the evaluation measures which depend on comparisons between the true and predicted labels.

Another feature is added to the framework; the user can specify the k value by different ways: first, the user can determine specific k values for the datasets. The user passes a list of k integer values corresponding to the list of datasets provided to the framework. Second, the user can choose the automatic option. The automatic option includes automatically deriving the k value from the true labels if the user provided supervised datasets, or applying different detection techniques to automatically predict the k value for each dataset. The detection techniques that are provided at the time of writing this paper are: elbow, gap analysis, Silhouette coefficient, Calinski–Harabasz (CH), Davies–Bouldin (DB), and Bayesian Information Criterion score (BIC) techniques. Other options include the minimum, maximum, median, and majority k values calculated from the values predicted by all these techniques.

Nature-Inspired Metaheuristics

The implementation of each optimizer is visible as a separate file in the framework. The optimizers that are available at the time of writing this paper are as follows:

  • Genetic algorithm (GA) [61]: It is inspired by biological evolution. The algorithm evolves toward better solutions based on four main operations: selection, crossover, mutation, and elitism.

  • Particle swarm optimization (PSO) [28, 62]: It is inspired by the flocking behavior of birds and the schooling behavior of fish. The algorithm evolves toward better solutions based on a mathematical formula considering the position and velocity of the particles. The movement of the particle is influenced by its local best and the global best positions.

  • Salp swarm algorithm (SSA) [39]: It is inspired by the swarming behavior of salps. The algorithm evolves toward better solutions based on two mathematical models to update the position of leading and follower salps.

  • Firefly algorithm (FFA) [71]: It is inspired by the flashing behavior of fireflies. The algorithm evolves toward better solutions by the attraction of fireflies based on the brightness of other fireflies calculated by the inverse square law.

  • Gray Wolf optimizer (GWO) [42]: It is inspired by grey wolves. The algorithm evolves toward better solutions based on hunting, searching for prey, encircling prey, and attacking prey.

  • Whale optimization algorithm (WOA) [40]: It is inspired by social behavior of humpback whales. The algorithm evolves toward better solutions based on three operators to simulate the search for prey, encircling prey, and bubble-net foraging behavior of humpback whales.

  • Multi-verse optimizer (MVO) [41]: It is inspired by the theory of multi-verse in physics. The algorithm evolves toward better solutions based on mathematical models of the white hole, black hole, and worm hole which reflect exploration, exploitation, and local search, respectively.

  • Moth flame optimizer (MFO) [38]: It is inspired by the death behavior of moths. The algorithm evolves toward better solutions based on logarithmic spiral update mechanism of moths.

  • Bat algorithm (BAT) [72]: It is inspired by the echolocation behavior of bats. The algorithm evolves toward better solutions based on the pulse of loudness and pulse rate.

  • Cuckoo search algorithm (CS) [73]: It is inspired by the brood parasitism of some cuckoo species. The algorithm evolves toward better solutions based on three idealized rules where the bird decides whether it throws the eggs away or abandons its nest and creates a new one.

Objective Functions

This component consists of the implementation of the objective functions that are used to optimize the individuals at each iteration. The list of objective functions which are used with the data sets having k clusters of N points, available at the time of writing this paper, are as follows:

  • Sum of squared error (SSE) [11]:

    $$\begin{aligned} \sum _{n=1}^{N}d_{nc}^2 \end{aligned}$$
    (1)

    where \(d_{nc}\) is the Euclidean distance between the centroid and the point. By minimizing SSE, we obtain better results.

  • Total within cluster variance (TWCV) [46]:

    $$\begin{aligned} \mathrm{{TWCV}} = \sum _{n=1}^{N}\sum _{f=1}^{F}p_{nf}^2 - \sum _{k=1}^{K}\frac{1}{|p_k|}\sum _{f=1}^{F}(\sum p_{kf})^2 \end{aligned}$$
    (2)

    where F is the number of features, \(p_{nf}\) is feature f of the point n, \(p_{kf}\) is feature f of the point k, and \(|p_k|\) is the number of points in cluster k. By minimizing TWCV, we obtain better results.

  • Silhouette coefficient (SC) [13, 46]:

    $$\begin{aligned} \mathrm{{SC}} = \frac{\sum _{k=1}^{|K|}((b - a) / max(a,b)))}{N} \end{aligned}$$
    (3)

    where a is the average distance between a point and the other points in the same predicted cluster, and b is the average distance between a point and the other points in the next nearest cluster. By maximizing SC, we obtain better results. We normalize the values of SC to the interval [0, 1], and then use the reversed value of the normalized SC (1 − norm(SC)) in the objective function.

  • Davies–Bouldin (DB) index [14]:

    $$\begin{aligned} \mathrm{{DB}} = \frac{1}{|k|}\sum _{k=1}^{|K|}\mathrm{{max}}_{k\ne j}\left( \frac{s_k + s_j}{d_{kj}}\right) \end{aligned}$$
    (4)

    where \(s_k\) is the average distance between a point and the cluster center, and \(d_{kj}\) is the distance between the centroid of cluster k and the centroid of cluster j. By minimizing DB, we obtain better results.

  • Dunn Index (DI) [13, 21]:

    $$\begin{aligned} \mathrm{{DI}} = \frac{d_\mathrm{{min}}}{d_\mathrm{{max}}}, \end{aligned}$$
    (5)

    where \(d_\mathrm{{min}}\) is the minimal distance between two points in different clusters, and \(d_\mathrm{{max}}\) is the maximal distance between the farthest two points in a cluster. By maximizing DI, we obtain better results. Thus, we use the reversed value of DI (1 − DI) in the objective function.

The extended feature, which considers different distance measures, is only effective for SSE, SC, and Dunn index.

Evaluation Measures

The framework includes a set of evaluation measures to evaluate the results obtained from running the framework. Given T as the true classes of N points and P as the predicted clusters of these points. The evaluation measures that are available at the time of writing this paper are as follows:

  • Purity (P) [6]:

    $$\begin{aligned} \mathrm{{Purity}} = \frac{1}{N} \sum _{j=1}^{k} \mathrm{{max}}_i(|T_i \cap P_j|) \end{aligned}$$
    (6)

    where \(P_j\) represents the points assigned to cluster j, k is the number of clusters, and \(T_i\) is the true assignments of points in cluster i.

  • Entropy (E) [6]:

    $$\begin{aligned} \mathrm{{Entropy}}=\sum _{j=1}^{k}\frac{(|P_j|)}{n}E(P_j) \end{aligned}$$
    (7)

    where E(\(P_j\)) is the individual entropy of a cluster. Individual cluster entropy is calculated by Eq. (8):

    $$\begin{aligned} E(P_j)=- \frac{1}{\mathrm{{log}} k} \sum _{i=1}^{k} \frac{|P_j \cap T_i|}{P_j} \mathrm{{log}}\left( \frac{|P_j \cap T_i|}{P_j}\right) \end{aligned}$$
    (8)
  • Homogeneity score (HS) [60]:

    $$\begin{aligned} \text {HS} = 1 - \frac{H(T|P)}{H(T)} \end{aligned}$$
    (9)

    where H(T) is the classes Entropy and H(T|P) is the classes conditional Entropy. H(T) and H(T|P) are calculated as follows [60]:

    $$\begin{aligned} H(T)= & {} - \sum _{t=1}^{|T|} \frac{n_t}{N} \cdot \log \left( \frac{n_t}{N}\right) \end{aligned}$$
    (10)
    $$\begin{aligned} H(T|P)= & {} - \sum _{p=1}^{|P|} \sum _{t=1}^{|T|}\frac{n_{pt}}{N} \cdot \log \left( \frac{n_{pt}}{n_p}\right) , \end{aligned}$$
    (11)

    where \(n_t\) and \(n_p\) are the number of points of the true class t and the predicted cluster p, respectively. \(n_{pt}\) is the number of points of the true class t which are clustered to the predicted cluster p.

  • Completeness Score (CS) [60]:

    $$\begin{aligned} \text {CS} = 1 - \frac{H(P|T)}{H(P)}, \end{aligned}$$
    (12)

    where H(P) is the cluster Entropy and H(P|T) is the clusters conditional Entropy. H(P) and H(P|T) are calculated as follows [60]:

    $$\begin{aligned} H(P)= & {} - \sum _{p=1}^{|P|} \frac{n_p}{N} \cdot \log \left( \frac{n_p}{N}\right) \end{aligned}$$
    (13)
    $$\begin{aligned} H(P|T)= & {} - \sum _{t=1}^{|T|} \sum _{p=1}^{|P|} \frac{n_{pt}}{N} \cdot \log \left( \frac{n_{pt}}{n_t}\right) . \end{aligned}$$
    (14)
  • V-measure (VM) [60]:

    $$\begin{aligned} \mathrm{{VM}} = 2 \cdot \frac{\mathrm{{HS}} \cdot \mathrm{{CS}}}{\mathrm{{HS}} + \mathrm{{CS}}} \end{aligned}$$
    (15)
  • Adjusted mutual information (AMI) [65]:

    $$\begin{aligned} \text {AMI} = \frac{\text {MI} - E[\text {MI}]}{\max (H(P), H(T)) - E[\text {MI}]} \end{aligned}$$
    (16)

    where H(P) and and H(T) are the cluster Entropy (Eq. 13) and the class entropy (Eq. 10). MI is the Mutual Index which is calculated by [65]:

    $$\begin{aligned} \text {MI} = \sum _{p=1}^{|P|}\sum _{t=1}^{|T|}\frac{n_{pt}}{N}\log \left( \frac{\frac{n_{pt}}{N}}{\frac{n_p}{N} . \frac{n_t}{N}}\right) \end{aligned}$$
    (17)

    E[MI] is the Expected Mutual Index which is calculated by [59, 65]:

    $$\begin{aligned} \begin{aligned} E\text {(MI)}&= \sum \limits _{p=1}^{|P|}\sum \limits _{t=1}^{|T|}\sum \limits _{n_{pt}=\mathrm{{max}}(0, n_p+n_t-N)}^{\mathrm{{min}}(n_p,n_t)} \frac{n_{pt}}{N} \mathrm{{log}}\left( \frac{N.n_{pt}}{n_p n_t}\right) \\&\quad \times \Bigl (\frac{n_p!n_t!(N - n_p)!(N - n_t)!}{N!n_{pt}!(n_p - n_{pt})!(n_t - n_{pt})!(N - n_p - n_t + n_{pt})!} \Bigr ). \end{aligned} \end{aligned}$$
    (18)
  • Adjusted Rand Index (ARI) [24]:

    $$\begin{aligned} \text {ARI} = \frac{\text {RI} - E[\text {RI}]}{\max (\text {RI}) - E[\text {RI}]}, \end{aligned}$$
    (19)

    where RI is the Rand Index, E[RI] is the Expected Rand Index, and max[RI] is the Maximum Rand Index. RI, E[RI], and max[RI] are calculated by Eqs. (20), (21), and (22) [24, 56], respectively:

    $$\begin{aligned} \text {RI}= & {} \frac{a + b}{\left( {\begin{array}{c}N\\ 2\end{array}}\right) } = \frac{\sum _{p,t}\left( {\begin{array}{c}n_{pt}\\ 2\end{array}}\right) }{\left( {\begin{array}{c}N\\ 2\end{array}}\right) } \end{aligned}$$
    (20)
    $$\begin{aligned} E\text {(RI)}= & {} E\left( \sum _{p,t}\left( {\begin{array}{c}n_{pt}\\ 2\end{array}}\right) \right) = \frac{\sum \nolimits _{p=1}^{|P|}\left( {\begin{array}{c}n_p\\ 2\end{array}}\right) \sum \nolimits _{t=1}^{|T|}\left( {\begin{array}{c}n_t\\ 2\end{array}}\right) }{\left( {\begin{array}{c}N\\ 2\end{array}}\right) } \end{aligned}$$
    (21)
    $$\begin{aligned} \text {max[RI]}= & {} \frac{1}{2}\left[ \sum \limits _{p=1}^{|P|}\left( {\begin{array}{c}n_p\\ 2\end{array}}\right) +\sum \limits _{t=1}^{|T|}\left( {\begin{array}{c}n_t\\ 2\end{array}}\right) \right] \end{aligned}$$
    (22)

    where a is the number of pair of points located in the same true class t and clustered at the same predicted cluster p. b is the number of pair of points located in a different true class t and clustered at a different predicted cluster p. \(\left( {\begin{array}{c}N\\ 2\end{array}}\right) \) is the number of pair of points.

  • Sum of squared error (SSE) [11]

  • Total within cluster variance (TWCV) [46]

  • Silhouette coefficient (SC) [13, 46]

  • Davies–Bouldin (DB) index [14]

  • Dunn Index (DI) [13, 21]

The last five measures are discussed in the previous section and are used as evaluation measures. These five measures are the only ones considered if the user provided unsupervised datasets having no true labels.

Benchmark Data Sets

Most common and well-known data sets used for clustering can be found in the framework in which it can be extended to include other data sets. The list of the data sets that are available at the time of writing this paper are summarized in Table 1. As observed from the table, the data sets have different number of points, features, and clusters. The data sets are either real-world or artificial synthetic data sets. They are gathered from scikit learn,Footnote 1 UCI machine learning repository,Footnote 2 School of Computing at University of Eastern Finland,Footnote 3 ELKI,Footnote 4 KEEL,Footnote 5 and Naftali Harris Blog.Footnote 6 These data sets are extensively found in the literature for solving the clustering problem [12]. The selected data sets have varying number of points allowing different experiments to be performed on different volume of data. Different dimensionality of the data sets are also available, which is a critical issue in machine learning problems.

Datasets are available in the framework in two representations: supervised and unsupervised, where supervised datasets contain the expected labels in the last column of the file, while unsupervised datasets do not contain this column.

Table 1 Data sets properties showing the name, number of clusters, number of points, number of features, data set type, and source

Results Management

The results obtained by running the framework are gathered in three types of CSV files and two types of plots:

  • Average results file: This file gives average results of the runs for performing each combination of an optimizer, objective function, and data set. Each item in the CSV file includes the average execution time, the average value of each external measure, and the average objective function value for each iteration. This file is important for two reasons: first, it shows how well the optimizers are performing. Second, it shows how the optimizer is enhancing the results by converging towards the optimal solution.

  • Detailed results file: This file gives detailed results for each run. Each item in the CSV file includes the execution time, the value of each external measure, and the value for each iteration. Practitioners and researchers find this file useful as it allows them to compare the results of different runs for the same combination of an optimizer, objective function, and data sets.

  • Best individual labels file: This file includes the values of the labels obtained from the best individual at the last iteration for each run. It is useful for the practitioners and researchers as it provides the final solution to the problem, which is the ultimate goal of using the framework for optimizing the clustering task.

  • Convergence curve plot: Plots are generated for the convergence curves for each selected data sets, optimizers, and objective functions. Each plot represents the convergence curves for multiple optimizers having the values of the objective function at each iteration. This plot is important as it shows how the solution is enhancing through different iterations.

  • Box plot: Plots are generated to represent the evaluation measures for each data set for several runs of the framework. Each box in a plot represents one of the selected optimizers. The interquartile range, best value, and worst value are represented as the box, the upper whiskers, and the lower whiskers, respectively [3]. This file helps in identifying the stability of the optimizer and showing the differences of the evaluation values between different runs.

Design Issues

The nature-inspired metaheuristic optimizers, which are included in the framework, use a population of individuals (s) at each iteration. Each individual represents one of the optimizers suggested clustering solution of centroids. Thus, consisting of the features (f) of each centroid for (k) clusters. Figure 1 shows how a population at a certain iteration is formed. For each individual in the group of s individuals in the population, there are k centroids having f features for each centroid.

Fig. 1
figure 1

Population of individuals at a specific iteration

In EvoCluster, populations are defined using the Numpy open-source Python package which is based on the N-dimensional array data structure. The metrics module of the sklearn package are used for the evaluation measures for HS, CS, VM, AMI, ARI, FM, SC, and DB. Distance measures are calculated using scipy.spatial.distance package. In addition, the normalize function of the preprocessing module in the sklearn package is used to normalize the values of the features for a data set to the interval [0, 1], to give similar weights to the features of the points. Each individual of a population in a certain iteration generates a corresponding vector of predicted labels which represents the cluster number for each point of the data set. This vector is evaluated using a selected objective function in the framework.

EvoCluster components and their relationships are illustrated as a class diagram in Fig. 2. EvoCluster contains fourteen classes which include ten classes for the metaheuristic algorithms and four other main classes. The main classes are Optimizer, Solution, Objectives, and Measures. The Optimizer class solves the partitional clustering task by using one of the metaheuristic algorithm which finds a Solution using an Objective function. This generates the global solution of the best clustering labels. The Optimizer then evaluates the labels using the Measures class.

Fig. 2
figure 2

Class diagram of EvoCluster

Experiments and Visualizations

In this section, we show some examples of conducting some experiments using EvoCluster. The framework is run 10 times using a population size of 50 and iterations value of 100.

Figure 3 shows the convergence curve for selected optimizers which are PSO, GA, GWO, FFA, and CS using the SSE objective function for Aggregation and Iris datasets for different distance measures which are Euclidean and Manhattan. The convergence curve represents the values of the objective function over the course of iterations. The convergence curve shows the progress of the optimizers toward the optimal solution by minimizing the value of the objective function. As observed from the figure, the optimizers show different behaviors. In addition, the same algorithm behaves differently for different data sets and with different distance measures. Figure 4 shows the box plot for the selected optimizers which are PSO, GA, GWO, FFA, and CS using the SSE objective function for the Aggregation data set for Purity and Entropy evaluation measures for Euclidean and Manhattan distance measures. The box plot represents the range of values of different runs. It also shows the max, min, and mean values of the evaluation measure.

Fig. 3
figure 3

Convergence curve plots for PSO, GA, GWO, FFA, and CS using SSE objective function and Elbow method for a aggregation with Euclidean distance; b aggregation with CityBlock/Manhattan distance; c Iris with Euclidean distance; and d Iris with CityBlock/Manhattan distance

Fig. 4
figure 4

Box plots of a purity with Euclidean distance; b purity with CityBlock/Manhattan distance; c entropy with Euclidean distance; and d entropy with CityBlock/Manhattan distance for PSO, GA, GWO, FFA, and CS using SSE objective function and Elbow method for the aggregation data set

The experiments in this section show that EvoCluster framework facilitates the work of the practitioners and researchers by performing comparisons between different metaheuristic algorithms based on different configurations and evaluation metrics. In addition, the end-point results are also provided in EvoCluster in various formats including results files and plots, which allows practitioners and researchers observe different views of the results and helps them evaluate their choice of the optimizers and configuration settings.

Conclusion and Future Work

EvoCluster is an open-source framework implemented in Python language which provides so-far ten nature-inspired metaheuristic optimizers that are customized to solve partitional clustering tasks. EvoCluster provides the ability to select one of five well-known objective functions and twelve well-known evaluation measures. The framework is designed in a flexible way so that developers and researchers can customize it by implementing other optimizers, objective functions, and evaluation measures. In this paper, we extend EvoCluster framework with different distance measures for the objective function, different ways to specify the k value, and a user option to consider either supervised or unsupervised datasets. We also show some visualizations that are automatically generated based on the results of the conducted experiments using the extended EvoCluster framework in the form of the convergence curves and box plots. As future work, it is planned to support the framework with more well-regarded and recent metaheuristics. In addition, the framework will be supported with different initialization mechanisms that can support the performance of the optimizers, and other encoding mechanisms and problem formulations. Further, EvoCluster framework can be upgraded to work on parallel architectures for handling larger datasets and speeding up the performance of the metaheuristic algorithms.