## 3 Causes of Health in Public Transport Operations  
### Random Forest Algorithm Based on Bagging  
(1) Principle of algorithm  
Among machine learning methods, in addition to single learning algorithms such as decision trees and Knn, there is also the very popular Ensemble learning machine learning algorithm. Figure 8 shows the schematic diagram of integration learning. Integrated learning refers to training several individual learners on the training set, and then combining them with some strategy to form a strong learner. This method of combining several individual learners usually provides better generalization performance than a single learner. Figure 8: Schematic diagram of integrated learning. Figure 6: Delay statistics for different license plates at the same time. Figure 7: Schematic diagram of the feature set of influencing factors. The Random Forest (RF) algorithm is an integrated learning algorithm based on the Bagging algorithm, which represents a parallel integrated learning algorithm that generates several individual learners without dependencies in parallel. Bagging is based on the Bootstrap sampling method, where T sampling sets are collected from a training set D containing Bagging is based on bootstrap sampling, which collects T samples from a training set D containing m samples to train individual learners, each sample set is as large as the original training set. The bootstrap sampling method means that each time a random sample is taken from the training set D and put into the sampling set, and then the sample is put back into the training set D, so that the sample still has a chance to be selected in the next sampling. By randomly sampling the training set D m times, a sampling set containing m samples can be obtained. Following the above steps, T sample sets containing m samples can be sampled, and then T individual learners can be trained. Finally, the T individual learners are combined to obtain a strong learner. When combining the outputs of the individual learners, the simple averaging method is used for the prediction of the regression problem, i.e., the average of the prediction results of all individual learners is used as the prediction result of the integrated learner. For the classification problem, the simple voting method is used, i.e., the one with the highest number of predicted samples x belonging to the category of T individual learners is used as the final classification category. Random Forest is an extended version of Bagging. Figure 9 shows a schematic diagram of the learning process of Random Forest. Random Forest is an integrated machine learning algorithm that uses CART decision trees as individual learners. First, T sample sets are sampled from a training set D containing m samples by a self-service sampling method. Then, each sampled set is learned using a decision tree. Random forest is called an extended version of Bagging, because it builds on the Bagging integration by introducing random feature selection when training decision trees. The traditional decision tree algorithm selects an optimal feature from all the features of the current node when selecting the nodes of the tree for dividing the features. In contrast, decision trees in random forests are constructed by first selecting a random subset of features from all the features of the current node and then selecting an optimal feature from the subset of features. This can further enhance the generalization performance of the integrated learner. Finally, the prediction results for the samples are cast using the simple voting method. The algorithm flow is shown in Table 6.  
Figure 9: Schematic diagram of the random forest learning process. (2) Evaluation of the importance of influencing factors  
The random forest model can output the magnitude of the influence of each influence factor on the health rating of public transportation operations. The variable importance score is a measure of the influence of the corresponding variable using the reduction in model accuracy.