# Incorporating Grey Total Influence into Tolerance Rough Sets for Classification Problems
## 4 Genetic-Algorithm-Based Learning Algorithm  
Basic genetic operations such as selection, crossover, and mutation [37; 38; 39] are involved in construction of the proposed GTI-TRSC. To construct a GTI-TRSC with high classification accuracy, \(n+3\) parameters--\(w_{1}\), \(w_{2}\),..., \(w_{n}\), \(\rho\), \(\alpha\), and \(\tau_{A}^{G}\)--constituting a chromosome were determined by a real-valued genetic algorithm (GA). The related parameters were the probability of crossover \(Pr_{c}\), probability of mutation \(Pr_{m}\), total number of generations \(n_{max}\), population size \(n_{size}\), and the number of elite chromosomes \(n_{del}\) (\(0\leq n_{del}\leq n_{size}\)). The pseudo-code of the learning algorithm is as follows Algorithm 1:  
```
Set 0 to \(k\); // \(1\leq k\leq n_{max}\) Initialize population (\(k\), \(n_{size}\)); Evaluate chromosomes (\(k\), \(n_{size}\)); While not satisfying the stopping rule do Set \(k+1\) to \(k\); Select (\(k\), \(n_{size}\)); //Select generation \(k\) from generation \(k-1\) Crossover (\(k\), \(n_{size}\)); Mutation (\(k\), \(n_{size}\)); Elitist (\(k\), \(n_{size}\)); Evaluate chromosome (\(k\), \(n_{size}\)); End while
```  
**Algorithm 1** The pseudo-code of the learning algorithm  
The function of each operation is as follows:  
1. Initialize population: The most common population size is between 50 and 500. Generate an initial population of \(n_{size}\) chromosome. Each parameter in a chromosome is assigned a real random value ranging from zero to one. 2. Evaluate chromosomes: Each chromosome corresponds to a GTI-TRSC that can be generated by the process shown in Figure 1. For each pattern, determine the lower and upper approximations for a GTI-based tolerance class. Furthermore, correct classification serves as a fitness function. Classification accuracy is the number of correct predictions made divided by the total number of predictions made, multiplied by 100 to turn it into a percentage. 3. Select: To produce generation \(k\), randomly select two chromosomes from generation \(k-1\) by a binary tournament and place the one with higher fitness in a mating pool. 4. Crossover: Let \(w_{i1}^{k}w_{i2}^{k}\ldots w_{in}^{k}\rho_{i}^{k}a_{i}^{k}\tau_{i}^{k}\) and \(w_{i1}^{k}w_{i2}^{k}\ldots w_{in}^{k}\rho_{i}^{k}a_{i}^{k}\tau_{i}^{k}\) be randomly selected chromosomes (\(1\leq i\), \(j\leq n_{size}\)) from generation k. Pr\({}_{c}\) determines whether crossover can be performed on any two real-valued parameters. Two new chromosomes, \(w_{i1}^{k-new}w_{i2}^{k-new}\ldots w_{in}^{k-new}\rho_{i}^{k-new}\alpha_{i}^{k- new}\tau_{i}^{k-new}\) and \(w_{j1}^{k-new}w_{j2}^{k-new}\ldots w_{in}^{k-new}\rho_{j}^{k-new}\alpha_{j}^{k- new}\tau_{j}^{k-new}\) are generated and are added into \(P_{k+1}\). The related crossover operations are performed as: \[w_{i^{new}}^{k-new} =a_{w}w_{i^{k}w}^{k}+(1-a_{w})w_{i^{k}w}^{k}\ w_{i^{k-new}}^{k-new} =(1-a_{w})w_{i^{k}w}^{k}+a_{w}w_{j^{k}w}^{k}(1\ \leq w\leq n)\] \[\rho_{i}^{k-new} =b\rho_{i}^{k}+(1-b)\rho_{i}^{k},\ \rho_{i}^{k-new} =(1-b)\rho_{i}^{k}+b\rho_{j}^{k}\] \[\alpha_{i}^{k-new} =c\alpha_{i}^{k}+(1-c)\alpha_{i}^{k},\ \alpha_{i}^{k-new} =(1-b)\alpha_{i}^{k}+b\alpha_{i}^{k}\] \[\tau_{i}^{k-new} =d\tau_{i}^{k}+(1-d)\tau_{j}^{k},\ \tau_{j}^{k-new} =(1-c)\tau_{i}^{k}+c\tau_{j}^{k}\] where \(a_{w}\), \(b\), \(c\), and \(d\) are random numbers ranging from zero to one. 5. Mutation: \(Pr_{m}\) determines whether a mutation can be performed on each real-valued parameter of a newly generated chromosome. With a mutation, the affected gene is altered by adding a random number selected from a prespecified interval, such as (\(-0.01\), \(0.01\)). A smaller \(Pr_{m}\) is required to avoid excessive perturbation. Elitist strategy: Randomly remove \(n_{del}\) chromosomes from generation \(k\). Insert \(n_{del}\) chromosomes with the maximum fitness from generation \(k-1\). A smaller \(n_{del}\) is required to generate a smaller perturbation in generation \(k\).