## 2 Materials and Methods
### Data Mining Techniques for PPRE Analysis
For example, \"_if condition 1 and condition 2 and... condition \(k\) occur, then outcome \(j\) occurs.\"_  
In order to construct a decision tree model, it is important to split the data into subtrees by applying criteria such as information gain and gain ratio. In our experiment, we applied the popular C4.5 decision tree algorithm, an extended algorithm of ID3 that uses information gain as its attribute selection measure. Information gain is based on the concept of entropy of information, referring to the reduction of the weight of desired information, which then determines the importance of variables [35]. C4.5 decision tree algorithm selects the attribute of the highest information gain (minimum entropy) as the test attribute of the current node. Information gain is calculated as follows:  
\[Information\ Gain(D,\ A)=Entropy(D)-\sum_{j=1}^{v}\frac{\left|D_{j}\right|}{ \left|D\right|}Entropy\left(D_{j}\right) \tag{6}\]  
where \(D\) is a given data partition, and \(A\) is the attribute (the extracted five features in our experiment). \(D\) is split into \(v\) partitions (subsets) as \(\left\{D_{1},D_{2},\ldots,\ D_{j}\right\}\). Entropy is calculated as follows:  
\[Entropy(D)=-\sum_{i=1}^{C}p_{i}\log_{2}p_{i} \tag{7}\]  
where \(p_{i}\) is derived from \(\frac{\left|C_{i}\ D\right|}{\left|D\right|}\), and has non-zero probability that an arbitrary tuple in \(D\) belongs to class (cluster, in our experiment) \(C\). The attribute with the highest information gain is selected. In the decision tree, entropy is a numerical measure of impurity, and is the expected value for information. The decision tree is constructed to minimize impurity. Note that in order to minimize entropy, the decision tree is constructed to maximize information gain. However, information gain is biased toward attributes with many outcomes, referred to as multivalued attributes. To address this challenge, we used C4.5 with \"gain ratio\". Unlike with information gain, the split information value represents the potential information generated by splitting the training dataset \(D\) into \(v\) partitions, corresponding to \(v\) outcomes on attribute \(A\). Gain ratio are used for split criteria and calculated as follows [37; 38]:  
\[GainRatio(A)=\frac{Information\ Gain(A)}{SplitInfo(A)} \tag{8}\]  
\[SplitInfo(A)=-\sum_{j=1}^{v}\frac{\left|D_{j}\right|}{\left|D\right|}\log 2 \left(\frac{\left|D_{j}\right|}{\left|D\right|}\right) \tag{9}\]  
The attribute with the highest gain ratio will be chosen for splitting attributes. In our experiment, there are two reasons for using the decision tree algorithm. First, we can validate the result of the k-means clustering algorithm. Unlike k-means clustering, the performance of the decision tree can be validated through its accuracy, precision, recall, and F1 score. Precision is the ratio of positive classification to the classified results, and recall is the ratio of data successfully classified in the input data [37; 39]. \[Precision=\frac{\mathit{TP}}{\left(\mathit{TP+FP}\right)} \tag{10}\]  
\[Recall=\frac{\mathit{TP}}{\left(\mathit{TP+FN}\right)} \tag{11}\]  
\[F1\ score=2\times\frac{\left(Precision*Recall\right)}{\left(Precision+Recall \right)} \tag{12}\]  
where \(\mathit{TP}\) is true positive, \(\mathit{FP}\) is false positive, and \(\mathit{FN}\) is false negative. Second, we can analyze the decision tree results in-depth, by treating them as a set of \"_if-then_\" rules applying to every vehicle-pedestrian interaction at that location. At the end of Section 3, we will discuss the results of the decision tree and confirm the feasibility and applicability of the proposed PPRE analysis system by analyzing these rules.