# A Modified Bayesian Network Model to Predict Reorder Level of Printed Circuit Board
## 3 Modified Bayesian Network Model Development  
### Bayesian Network  
Bayesian network (also known as belief network and causal network) is a probabilistic graphical model that represents a set of random variables and their conditional dependence by means of a directed acyclic graph (DAG) and CPTs [19; 20]. Each node in DAG represents a variable of the ranges over a discrete set of domain and contacts with its parent's nodes [14] and directed arcs represent the condition or probability dependency between random variables [14; 28]. BN has become a popular knowledge-based representational scheme in data mining [27; 28; 29; 30]. This graphical structure, which expresses causal interactions and direct/indirect relations as probabilistic networks, has secured BN's popularity. Experts can easily understand such structures and (if necessary) modify them to improve the model [28]. The critical problem in establishing a BN is to determine the network structure \(S\) and corresponding set of parameters \(\theta\)[28; 29], which are always called structure learning and parameter learning, respectively. In order to reduce arcs between nodes (variables) with weak causal interactions and corresponding CPTs, CMI and LSP were combined with expert's experience to establish BN structure and, therefore, avoid the defects of TAN. The CMI was first introduced in TAN [31] by relaxing the conditional independence assumption of naive Bayesian for the purpose of selecting particular dependences [15]. However, TAN links all the input variables (evidence node) to output variables (class node) and allows at most two parents nodes with one connection to the class node and one causal connection to another evidence node, which easily misses some strong links and sometimes generates redundant weak strength links [28] that are negative for the robustness and generalization of the BN model. Suppose a set of discretized random variables is \(X=\{x_{1},x_{2},\ldots,x_{9}\}\) corresponding to the variables such as a layer number, recency, and \(F1\)-\(F7\) and CMI between \(x_{i}\) and \(x_{j}\) can be computed below. \[\text{CMI}(x_{i};x_{j}|\text{Rel})=\sum_{m,n,k}P(x_{i}^{m},x_{j}^{n},\text{Rel }_{k})\ln\frac{P(x_{i}^{m},x_{j}^{n}|\text{Rel}_{k})}{P(x_{i}^{m}|\text{Rel}_{ k})P(x_{j}^{n}|\text{Rel}_{k})},i\
eq j \tag{4}\]  
where \(x_{i}^{m}\), \(x_{j}^{n}\), and\(\text{Rel}_{k}\) represent the \(m\)th, \(n\)th, and \(k\)th values of \(x_{i}\), \(x_{j}\), and Rel, respectively, \(\text{CMI}(x_{i};x_{j}|\text{Rel})\) measures the information \(x_{j}\) provides on \(x_{i}\) when the value of reorder level Rel is known. The smaller the \(\text{CMI}(x_{i};x_{j}|\text{Rel})\) value is, the weaker the connection between \(x_{i}\) and \(x_{j}\) is. The LSP from parent node \(x\) to child node \(y\) is defined by the equation below. \[\text{LSP}(x\to y)=100\times\frac{Ent(y|Z)-Ent(y|x,Z)}{Ent(y|Z)} \tag{5}\]  
where \(Z=Pa_{y}/\{x\}\) denotes a set of all parents of \(y\) other than \(x\), \(Ent(y|Z)=\sum\limits_{z}P(z)\sum\limits_{z_{2}}P(y|z)\log_{2}(1/P(y|z))\), and \(Ent(y|x,Z)=\sum\limits_{x_{i}}P(x,z)\sum\limits_{z_{2}}P(y|x,z)\log_{2}(1/P(y| x,z))\). LSP can be interpreted by how much the uncertainty (in percentage) in class variable is reduced by knowing the state of an input variable if the states of all other parent variables are known. LSP plays an important role to evaluate the quality of the BN structure and can facilitate experts to modify arrows based on link strength values [32]. The structure learning algorithm is depicted below (Algorithm 3).