# Swarm Intelligence Algorithms for Feature Selection: A Review
## 5 Swarm Intelligence for Feature Selection
### Update and Move Agents  
In the ABC algorithm, the neighborhood exploration is done by a small perturbation using Equation (4)  
\[v_{ij}=x_{ij}+\Phi_{ij}(x_{ij}-x_{kj}) \tag{4}\]  
where \(v_{ij}\) is the candidate food source, parameter \(x_{ij}\) represents the food source, indices \(j\) and \(k\) are random variables and \(i\) is the index of the current food source. Parameter \(\Phi_{ij}\) is a real number in the interval \((-1,1)\). In the proposed algorithm for FS based on ABC [38], the Modification Rate (\(MR\)), also called perturbation frequency, is used to select features with Equation (5):  
\[x_{i}= \begin{cases}1,&\text{if }R_{i}<MR,\\ 0,&\text{otherwise.}\end{cases}  \tag{5}\]  
If the randomly generated value between 0 and 1 is lower than the \(MR\), the feature is added to the feature subset. Otherwise, it is not. In [41], the update is done using the same equation as in the initially proposed ABC algorithm. Therefore, the sigmoid function is used (Egaution (9)) for the transformation of values. In [46], researchers proposed a two-sided DA algorithm in which the update of dragonflies' position is done using Equation (6):  
\[\Delta X_{t+1}=(sS_{i}+aA_{i}+cC_{i}+dF_{i}+eE_{i})+w\Delta X_{t} \tag{6}\]The meaning of the components in Equation (6) are in the following order: Separation, alignment, cohesion, attraction, and distraction of the \(i\)th dragonfly, all summed with the inertia weight and the step. Discretization of variables' values is done using Equation (7):  
\[X_{i,t+1}= \begin{cases}1,&r<T(\Delta X_{i,t+1}),\\ 0,&r\geq T(\Delta X_{i,t+1}).\end{cases}  \tag{7}\]  
In Equation (7), the \(T(\Delta X_{i,t+1})\) set the step for variables is based on Equation (8):  
\[T(\Delta X_{i,t+1})=\left|\frac{\Delta X_{i}}{\sqrt{\Delta X_{i}^{2}+1}}\right| \tag{8}\]  
The researchers in [42] used sigmoid function \(sig_{ij}\) for the creation of the probability vector in the FA algorithm. The final position update is done after that with the Sigmoid function (Equation (9)) where the rand is defined in [0, 1]. \[x_{ij}^{t+1}= \begin{cases}1,&\text{if }sig_{ij}\geq rand,\\ 0,&\text{otherwise}.\end{cases}  \tag{9}\]  
Instead of a Sigmoid function, researchers in [58] proposed the tanh function to improve the performance of an FA algorithm. The tanh function is responsible for scaling values to binary ones based on Equation (10) in which are the parameters \(i=1,\dots,n\) (\(n\) = number of fireflies) and \(k=1,\dots,m\) (\(m\) = number of dimensions). \[f(X_{i}^{k})=\frac{exp(2X_{i}^{k})-1}{exp(2X_{i}^{k})+1}. \tag{10}\]  
The difference between Sigmoid and tanh functions is presented in Figure 6.  
The movement of fireflies in the FA algorithm [53] is done using Equation (11):  
\[X_{i}(t+1)=X_{i}(t)+\beta(X_{i}(t)-X_{j}(t))+\alpha(rand-\frac{1}{2}) \tag{11}\]  
Figure 6: Sigmoid and tanh functions. in which \(X_{i}(t)\) and \(X_{j}(t)\) determine the position of the less bright and brighter fireflies, respectively. Parameter \(\beta\) comprises the attractiveness component. Discretization is done using the Sigmoid function. In [50], the change of glow-worms' positions is done using a step size calculated for each feature. The primary goal of glow-worms is to minimize the distance between features. The changes of chosen features are done in the GSO algorithm with Equation (12):  
\[new\_dim= \begin{cases}ceil(orig\_dim-(rand*5)),&\text{if }probability<0.75,\\ceil(orig\_dim+(rand*5)),&\text{if }probability>0.75.\end{cases}  \tag{12}\]  
where \(orig\_dim\) and \(new\_dim\) are original and new dimensions, respectively, and \(\text{rand}=(0,1)\). Updating the roach location in the RIO algorithm is a composite of three parts [49]. The first part of Equation (13)  
\[ \begin{split} a=C_{o}\oplus CR(C_{o}\oplus CR(w\oplus MT(x_{i}),p_{i}),l_{i})\\ x_{i}=\begin{cases}a,&\text{if }hunger_{i}<hunger,\\ random,&\text{otherwise}.\end{cases}\end{split}  \tag{13}\]  
is velocity component \(w\oplus MT(x_{i})\) updated with mutation operator.