# Identification of Risk Factors for Bus Operation Based on Bayesian Network
## 2 Methodology and Dataset
### Methodology
BN is a probabilistic graphical model that uses Bayesian inference for probability calculation. A BN was built using the concept of directed acyclic graphs in graph theory by analyzing the mutual influence between independent and dependent variables. We determined the edge probability in a directed acyclic graph by applying a Bayesian formula. The interrelationships between the variables could be abstracted using a topological framework of points and edges by building a directed acyclic graph. In a BN, the direct correlation between different variables is represented by edges, and each vertex represents a random variable. Every random variable consistently influences the dependent variable and is independent of other variables. BN can be represented as \(N=(G,\ P)\), where \(N\) represents the network, \(G\) represents the graph, and \(P\) represents the joint probability of the network. \(G\) is a graph that can be further represented by \((V,\ E)\), where \(V\) represents the set of nodes \((x_{1},\ x_{2},\ x_{3},...,x_{n})\), \(E\) represents the directed edges of causal relationships between variables. The construction of BNs usually adopts three methods: data-driven methods, knowledge-based methods, and a combination of the two methods [29]. Data-based methods use the conditional independence semantics of BN to generalize models from data. The knowledge-based approach utilizes the causal knowledge of domain experts to construct BNs. Different experts may have different opinions on the same issue, resulting in knowledge-based methods having a significant subjective component. The bus operation monitoring system is dynamically changing, while BNs based on knowledge construction are usually static. To adapt to changes, it is necessary to constantly update the model structure and parameters, which is very time-consuming and difficult in practice. With the advancement of big data technology, data-driven automatic learning methods can provide better model performance in certain scenarios. For example, ML algorithms can be used to automatically learn BNs from data. At present, the main categories of structural learning include independence testing and score-based search. Due to the need for a large number of samples to test independence, the method of independence testing has a high time cost. Sometimes, unreliable conditional independence testing may amplify errors in the input stage and propagate them to the output stage, leading to a decrease in the accuracy of network inference results. The method of core-based search generally first selects the scoring criterion of the network structure and then searches for the network structure with the best rating. Although this type of method can search for optimal network structures, it is prone to getting stuck in local optimal structures due to the large search space and the decomposability of the scoring function for local or random searches. The search for the optimal BN structure from all possible network structure spaces has been proven to be an NP-Hard problem [30]. Therefore, score-based search methods generally adopt heuristic strategies to reduce search space. Therefore, we need to determine a scoring criterion for BN structures and then obtain the network structure with the highest score by heuristic search methods. Common scoring criteria include BIC, BDE, MDL, etc. BIC can measure the fit between structure and data. It has penalty terms related to model complexity and is widely used as a scoring criterion in large sample data. Therefore, BIC was chosen as the scoring criterion in the research. Common heuristic algorithms include K2, hill climbing in greedy search, and tabu search (TS). However, the K2 algorithm requires a known node order, which imposes high limitations on its application. Moreover, greedy algorithms are prone to getting stuck in local optima. TS has no special requirements for the objective function. It can jump out of local optima and approach global optima based on its unique memory mechanism.