# Co-Operative Binary Bat Optimizer with Rough Set Reducts for Text Feature Selection
## 3 The Proposed Algorithm
### Initialization Stage
Thus, seven features are yielded for sub-population #1 to #2 (i.e., _Size-PartialSolution_ +1 = 6 + 1 = 7). The remaining one sub-population remains with six features. Figure 4 shows how the full dimension of features, _FullSolution_ (i.e., 20 features) is divided and assigned into three sub-populations where the first two sub-populations consist seven features, and the third sub-population consists of six features. Note that the letters in Figure 3 represent the features where the arrows represent the movement of features to the sub-populations and # is number (#2 equals to _number 2_). The full dimension of features (20 features)  
Figure 3: Subsets of features into sub-populations assignment. Figure 2: Graphical results of the Taguchi method for BBA\({}_{\text{CO}}\) algorithm. In Step 3, each candidate solution in all sub-populations is evaluated based on the adapted dependency degree measure using rough set theory. For example, in Figure 4 the selected features are \(a\) and \(d\). Thus, the quality of the _PartialSolution_ is calculated based on the dependency degree between feature \(a\) and \(d\) using the adapted rough set theory (RST). In the adapted RST, the features are represented by their presence or absence in the document. In this way, the candidate solutions could be compared with the instances (i.e., documents) to define the lower and upper approximations. However, it was found that there is no instance that can have the same pattern of the solution in order to be added to a lower approximation due to the high dimensionality of the feature space. To handle this limitation, the similarity between each instance and the candidate solution is calculated using cosine similarity measure as in the following equation. The similarity threshold (\(\delta=0.70\)) is defined based on the preliminary experiments:  
\[cos(d_{i},cs)=\frac{\sum_{k=1}^{n}d_{i}^{k}\cdot cs^{k}}{\sqrt{\sum_{k=1}^{n} \left(d_{i}^{k}\right)^{2}}\cdot\sqrt{\sum_{k=1}^{n}\left(cs^{k}\right)^{2}}}\]  
where \(d_{i}\) is the document number \(i\); \(cs\) is the candidate solution, \(d_{i}^{k}.cs^{k}\) is the dot product between \(d_{i}\) and \(cs\); \(k\) is the index of the term and \(n\) is the number of the selected terms in the candidate solution. After calculating cosine similarity, if its value is equal or greater than \(\delta\) the document is added to the lower approximation, otherwise, it is not added. The best _PartialSolution_ from each sub-population is assigned to \(x_{\text{test}}^{i}\), and is concatenated as follows:  
\[x_{\text{best}}=concatenate(x_{\text{best}}^{1}\,\ x_{\text{best}}^{2}\,\ x_{\text{best}}^{3}\,\ \ldots\,\ x_{\text{best}}^{subPop-m0})\]  
Modified LHS: Initial Population Generation  
Latin Hypercube Sampling (LHS) is a statistical method developed by the author of [67] and used for sampling by ensuring that all portions of the continuous variable were sampled. LHS was used as an initialization method by the authors of [68], where the solutions were represented using real values as the problem was continuous. For initializing the candidate solutions of BBACO, the LHS method was modified to be applicable to the problems with binary representation. The modified LHS works as follows:  
1. Divide the length of the solution into equal segments, where the length of the solution is equal to the number of features. The following equation is used to determine the number of segments in each solution: \[sn=\frac{F}{n}\text{random}(1,m)\]  
\[\textit{Size-PartialSolution}=\textit{F/SubPop-no}\]0 A sample _PartialSolution_ from sub-population #1. \[m=\left\{ \begin{array}{ll}\frac{F}{n}\text{ if }\frac{F}{n}\leq\frac{n}{2}\\ \frac{n}{2}\text{ if }\frac{F}{n}>\frac{n}{2}\end{array} \right.\]  
where \(sn\) refers to the number of segments; \(F\) is the number of features and \(n\) is the number of solutions in the population. \(\frac{F}{n}\) provides the number of segments that guarantees using each feature only one time in one solution.