# A Modified Bayesian Network Model to Predict Reorder Level of Printed Circuit Board
## Variables Specification and Data Preprocessing
### Data Discretization  
The entropy minimization based binning method employed in this paper has been widely applied in discretizing variables [23]. The core measures of entropy minimization based discretization include information entropy and gain [24; 25]. Let \(k\) classes be \(C_{1},C_{2},\ldots,C_{k}\) in samples set \(S\) and let \(P(C_{i},S)\) be the proportion of samples in \(S\) that has class \(C_{i}\). The entropy of \(S\) is defined by the equation below. \[Ent(S)=-\sum_{i=1}^{k}P(C_{i},S)\log_{2}P(C_{i},S) \tag{1}\]  
where \(Ent(S)\) measures the amount of information needed to specify the classes in \(S\). The greater the \(Ent(S)\) value is, the more information it contains and the lesser purity it has. A binned interval with all values belonging to the same class has the highest purity [26; 27]. Entropy of samples \(S\) partitioned by an arbitrary split point \(T\) of attribute \(X\) into two disjoint intervals is defined by the equation below. \[Ent(X,T;S)==\sum_{j=1}^{2}\frac{|S_{j}|}{|S|}Ent(S_{j}) \tag{2}\]  
where \(|S_{j}|\) and \(|S|\) are the sample size of subset \(S_{j}\) and \(S\), respectively. The information gain for a variable \(X\) based on a given split point \(T\) can be defined by Equation (3). \[Gains(X,T;S)=Ent(S)-Ent(X,T;S) \tag{3}\]  
A partition induced by a split point \(T\) for a set \(S\) is accepted according to the minimum description length principle (MDLP) [24]. The binning algorithm for the discretization of each variable (i.e., F1-F7, layer number and recency) is described below. The maximum number of the binned intervals was set to 10 and the discretization results of the variables obtained by Algorithm 2 are given in Table 4. Split points were used directly for the discretization of the test samples. Proportions of the different reorder levels for the training samples in the different binned intervals of the variables are illustrated in Figure 4.  
It can be seen that proportions of the different reorder levels in the different binned intervals vary significantly, which indicates that the cumulative delivery quantity/area (\(F1\) and \(F3\)), delivery interval day (\(F5\)), and continued days (\(F2\)) are also important for classification of reorder level besides RFM (i.e. _Rec_, \(F7\), and \(F4\)). Proportion of reorder level 2, 3, and 4 decreases with an increase in the value of discretized recency and the reorder level of the samples with the binned interval 10 for recency canalmost directly be classified as 1. \(F7\) performs the opposite tendency compared to recency in which the sample with the binned value 1 or 2 has high purity (probability) to be classified as 1. A sample with the binned recency as 1, \(F7\) as 6, \(F2\) or \(F3\) as 1, or \(F7\) as 9 has high probability to be classified as 4. \begin{table}
\begin{tabular}{c c} \hline \hline
**Variables (Factors)** & **Split Points** \\ \hline _Ln_ & 4, 10 \\ _Rec_ & 11, 36, 67, 114, 172, 195, 325, 440, 714 \\ \(F1\) & \(-\)0.09, 0.002, 0.211, 1.221, 2.436 \\ \(F2\) & \(-\)0.767, \(-\)0.634, \(-\)0.496, 0.026, 0.787, 178 \\ \(F3\) & \(-\)0.532, \(-\)0.311, \(-\)0.251, \(-\)0.173, \(-\)0.024, 0.534 \\ \(F4\) & \(-\)0.802, \(-\)0.481, \(-\)0.09, 0.872 \\ \(F5\) & \(-\)0.1097, 0.443 \\ \(F6\) & \(-\)0.879, \(-\)0.586, \(-\)0.329, 0.009, 1.432 \\ \(F7\) & \(-\)1.009, 0.628, 0.386, 0.023, 0.401,1.335, 1.865, 3.501 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Discretized results of variables. Figure 4: Proportions of different reorder level in different binned intervals. ```
Input: Samples \(S\), samples size \(N\), variable \(x\), classes of reorder level \(\text{Rel}=\{1,2,3,4\}\), and maximum number of binned interval \(MaxIntv\).