# Swarm Intelligence Algorithms for Feature Selection: A Review
## 5 Swarm Intelligence for Feature Selection
### Fitness Function  
Each solution \(\vec{X}_{i}=[x_{i1},x_{i2},\ldots,x_{id}]\) (\(d\) and \(i=1,2,\ldots,n\) represents the dimension of solutions and number of solutions \(n\), respectively) in the used SI technique must be evaluated by some fitness function \(f(\vec{X}_{i})\). Based on the algorithms presented in Section 2, the solution comprises mainly the search agent. For example, in the PSO, the search agent is a particle, in GSO a glow-worm, and in RIO a cockroach. The difference is, for example, in the ABC algorithm, where the solutions represent the food sources. Fitness function is many times expressed as a classification accuracy. Many researchers use SVMs as the classifier method to evaluate solutions (e.g., [33; 38; 50; 51; 52]). Researchers in [46] proposed fitness function that is the average of the classification error rate obtained by three classifiers, SVM variations, \(v\)-SVM, C-SVM and LS-SVM in the DA algorithm. The average results were used to prevent generation of a feature subset based on a single classifier. In [53], the C-SVM classifier using the Radial Basis Function kernel (RBF) was applied in the FA algorithm. Classification performance is also evaluated frequently with KNN. In [36], the authors first evaluated each ant in ACO through KNN, and then used Mean Square Error (MSE) for performance evaluation. For the same algorithm, i.e., ACO, the researchers in [35] used KNN (K = 1). The classification performance was also evaluated with KNN (K = 5) in the binary ABC algorithm [54]. In [44], researchers proposed fitness function where each solution is measured with the Overall Classification Accuracy (OCA) in which the 1-Nearest Neighbor (1 NN), K-Nearest Neighbor (KNN), or Weighted K-Nearest Neighbor (WKNN) is called. The value of K is changed dynamically based on iterations of the algorithm. With this approach, researchers enabled the diversity of the solutions in each iteration. Composed weighted fitness function is also used in the GWO algorithm [40], which comprises an error rate and a number of selected features. Some other approaches comprise classification accuracy of Optimum-Path Forest (OPF) in the BA algorithm [55], Root Mean Squared Error (RMSE) in FA [56], Greedy Randomized Adaptive Search Procedure (GRASP) algorithm for clustering in ABC [41], and Back Propagation Neural Network (BPNN) in RIO [49] and ACO [57]. Composed fitness function based on rough sets and classification quality is proposed in [58]. [PERSON] and [PERSON] [48] proposed fitness function (Equation (1)),  
\[\frac{1}{(k_{1})\times ED+(k_{2})\frac{n_{s}}{n_{t}}} \tag{1}\]which is composed of Euclidean Distance (ED) used by the Minimum Distance Classifier (MDC) in the classifying process and some other parameters, i.e., weighted factors \(k_{1}\) and \(k_{2}\), and the number of selected features and total number of features \(n_{s}\) and \(n_{t}\), respectively. Rough set reduct was also used in one of the first ACO algorithms for FS [59]. Authors in [47] proposed composite fitness function, which uses the classification accuracy and number of selected features \(nbFeat\) (Equation (2)). SVM and NB classifiers obtained the classification accuracy, respectively. \[90\%\times accuracy+10\%(\frac{1}{nbFeat}) \tag{2}\]  
In [43], the objective function is composed of the classification accuracy rate of KNN classifier (K = 7) and the measure class separability. Based on that, five variants were proposed, of which two are weighted sums. The first three use classification accuracy (\(f_{1}\)), Hausdorff distance (\(f_{2}\)), and Jeffries-Matusita (JM) distance (\(f_{3}\)), respectively; the fourth is the weighted sum of (\(f_{1}\)) and (\(f_{2}\)); and the last one is the weighted sum of (\(f_{1}\)) and (\(f_{3}\)). The weighted fitness function is also used in [45]. The first part comprises the classification accuracy obtained by a KNN classifier (K=1) and the second part the number of selected features (Equation (3)).