# An Improved Artificial Bee Colony for Feature Selection in QSAR
## 4 The Proposed Method
### An Improved ABC Algorithm for FS in QSAR
#### 4.3.3 Novel Greedy Selection Strategy  
If the fitness value of \(x^{\prime}_{i}\) is higher than \(x_{i}\), \(x^{\prime}_{i}\) replaces \(x_{i}\) and enters next iteration. If the fitness of \(x^{\prime}_{i}\) is the same as \(x_{i}\), but its number of selected features is less than or equal to the \(x_{i}\), \(x^{\prime}_{i}\) replaces \(x_{i}\) and enters next iteration as well. Else, \(x_{i}\) enters the next iteration and \(x^{\prime}_{i}\) is discarded. To make it easier to understand, we give the following example, as shown in Figure 3.  
Figure 1: Two-point crossover operator. Figure 2: Two-way mutation operator. There are nine cases of whether an individual updates or not in Figure 3, where \(x^{t}\) and \(x^{tt}\) denote food source and its offspring in the current iteration, respectively. \(x^{t+1}\) denotes the individual entering the next iteration. \(fitness\) is the prediction accuracy and \(sum\) is the number of selected features. The first three cases indicate that, if \(x^{t}\) has the same fitness value with \(x^{tt}\) and its number of selected features is the same as or more than \(x^{tt}\), it will be replaced by \(x^{tt}\), otherwise, it will enter the next iteration directly. If the fitness value of \(x^{t}\) is smaller than \(x^{tt}\), it will also be replaced by \(x^{tt}\) regardless of the number of features it selects, which is shown as cases 4-6. In another three cases, \(x^{t}\) with a larger fitness value than \(x^{tt}\) will enter the next iteration without update. Combining the above three together, the ABC-PLS-1 is proposed. Figure 4 shows the flowchart of ABC-PLS-1 and pseudo code is outlined in Algorithm 2. Overall, the two-point crossover and two-way mutation operators not only save on the process of converting continuous space into discrete space, but also reduce the consumption of computing resources. Furthermore, the greedy selection strategy greatly reduces the possibility of food sources being abandoned so that the algorithm can converge fast to the optimal solution, thereby, the scout bee phase of ABC algorithm does not improve the prediction performance, so it can be omitted. This conclusion will be verified by setting different thresholds that determine whether to carry out the scout bee phase. Figure 3: The novel greedy selection strategy. ```
0: Population size \(SN\), Maximum number of iterations \(MaxIt\), Abandonment limit \(L\), \(counter=0\), \(t=0\). 0: The optimal food source \(x_{best}\), the best fitness value \(f(x_{best})\). 1: Initialize the population \(x_{i}\), (\(i=1,2,\ldots SN\) ) by using Equation (4). 2: Evaluate the fitness value of each food source by using Equation (1). 3:while\(t\leq MaxIt\)do
4: % Employed bee phase
5:for each employed bee do
6: Randomly select a different food source \(x_{k}\). ```  
**Algorithm 2** Pseudo code of the ABC-PLS-1 algorithm  
Figure 4: The flowchart of ABC-PLS-1. ```
0: Population size \(SN\), Maximum number of iterations \(MaxIt\), Abandonment limit \(L\), \(counter=0\), \(t=0\). 0: The optimal food source \(x_{best}\), the best fitness value \(f(x_{best})\). 0: Generate a new food source by crossover operator and mutation operator on \(x_{i}\) and \(x_{k}\). 0: Evaluate the fitness value of each food source by using Equation (1). 0: Update \(x_{i}\) according to greedy selection, and increase its \(counter\) counter by 1 if not update. 10:endfor
11: Calculate the selection probability of each food source by using Equation (6). 12: % Onlooker bee phase
13:for each onlooker bee do
14: Select a food source \(x_{i}\) according to the selection probability by roulette-wheel scheme. 15: Randomly select a different food source \(x_{k}\). 16: Generate a new food source by crossover operator and mutation operator on \(x_{i}\) and \(x_{k}\). 17: Evaluate the fitness value of each food source by using Equation (1). 18: Update \(x_{i}\) according to greedy selection, and increase its \(counter\) counter by 1 if not update.