## 3 Methodology
### eGA-DT Model for Factor Identification
#### 3.3.2 Construction of eGA Model  
The construction of the GA model combined with the strategy of elitist preservation is described as follows.  
1. Encode factors with a binary digit  
Numerous potential factors may cause bus bunching, and each factor could be regarded as a binary gene, which is the basic unit of a chromosome. A binary digit is utilized to indicate if the factor is selected. Code 1 means the factor is selected, while 0 means unselected. Different combinations of the binary genes would create a large number of chromosomes, representing different groups of selected factors.  
2. Initialize the population  
To generate the initial population, the length of the chromosome L and the number of initial chromosomes N should be determined. The initial population may not contain the best individual, so the following steps for crossover, mutation, and fitness selection are extremely important.  
3. Evaluate the fitness of each individual  
Individuals with better fitness have a greater chance of being selected, so the fitness selection model plays a decisive role in the results. The DT model is adapted to assign the fitness value. In addition, different methods of data division also affect the result of selection. Thus, 5-fold cross-validation is adapted to reduce the dependence on data sets and ensure that the model has a strong generalization ability for data. Mean absolute error  
Figure 2: The overall framework of the eGA–DT model.  
(MAE) is selected to verify the results. The fitness of an individual could be expressed as follows:  
\[F_{i}=\frac{1}{\frac{1}{5}\sum_{i=1}^{5}S_{i}} \tag{1}\]  
where \(S_{i}\) is the MAE of each fold cross-validation and \(i\) ranges from 1 to 5.  
4. Select the chromosome  
The probability of the individual selection is proportional to its fitness value, and chromosomes with better fitness are more likely to be selected into the next generation. The probability of each individual being selected is as follows:  
\[P_{i}=\frac{F_{i}}{\sum_{i=1}^{n}F_{i}} \tag{2}\]  
where \(F_{i}\) is the fitness value of each individual and n is the total number of individuals.  
5. Elitist preservation  
To avoid destroying the best fitness individual from crossover and mutation, the strategy of elitist preservation is used during selection. According to the fitness evaluation of each individual as discussed before, the individual with the highest fitness \(F_{i}\) is regarded as the best individual in the population, which is directly copied to the next generation without crossover and mutation. Meanwhile, the individual with the smallest fitness is eliminated to ensure a certain population size.  
6. Chromosome crossover  
Genes from different chromosomes are randomly crossed to generate new chromosomes. Set the probability of the crossover as \(P_{c}\), and the number of chromosomes participating in the crossover is \(P_{c}\times N\).  
7. Chromosome mutation  
To avoid the model falling into the local optimal result, variant genes are randomly selected from chromosomes to replace original genes and form the new population. Set the probability of the chromosome mutation as \(P_{m}\).  
8. Identify significant factors  
After a certain number of iterations, the value of the fitness remains unchanged, and the algorithm ends. The best individual could be selected, and significant factors of bus bunching are also identified.