# A Predictive Pedestrian Crash Model Based on Artificial Intelligence Techniques
## 3 Results and Discussion  
The results obtained on the test set in the five-fold iterations are presented in Table 4 in terms of recall (Equation (1)) and precision (Equation (2)) for the low-, medium-, and high-risk classes. In the same table, the model accuracy (Equation (3)) is displayed for the five-fold iterations. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Variables** & **Role** & **Type** \\ \hline Number of lines & Independent variable & Numerical—discrete \\ Morning traffic & Independent variable & Numerical—continuous \\ Afternoon traffic & Independent variable & Numerical—continuous \\ Evening traffic & Independent variable & Numerical—continuous \\ Night traffic & Independent variable & Numerical—continuous \\ Section type & Independent variable & Categorical \\ Presence of bus stop & Independent variable & Categorical \\ Presence of parking lots & Independent variable & Categorical \\ One way street & Independent variable & Categorical \\ Presence of pedestrian crossing & Independent variable & Categorical \\ Presence of road bump & Independent variable & Categorical \\ Presence of traffic light & Independent variable & Categorical \\ Level of risk & Dependent (Output) variable & Categorical \\ \hline \hline \end{tabular}
\end{table} 
Table 3: List of variables used on the model: Role and type. The average value, the minimum, and the maximum recall and precision (per class), and the accuracy among the five iterations are shown in Table 5.  
Figure 5 can help us better interpret the results: The observations are labelled in three groups of risk (low, medium, and high) and can be predicted in one of these three classes. When this happens, the observation falls in one of the three green squares representing the observations of low risk predicted as low risk (OLPL), the observations of medium risk predicted as medium risk (OMPM), and the ones of high risk predicted as high risk (OHPH). On average, the model has an accuracy of 0.7, which means that 70% of the observations are correctly classified and, therefore, fall in the three green squares of Figure 5. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline \multicolumn{7}{c}{**Results of the 5-Fold Iterations**} \\ \hline
**Measures** & **Class** & **Value** & **Value** & **Value** & **Value** \\ \hline Recall & Low risk & 1.000 & 0.733 & 0.800 & 0.875 & 1 \\ Recall & Medium risk & 0.737 & 0.938 & 0.900 & 0.647 & 0.550 \\ Recall & High-risk & 0.556 & 0.500 & 0.800 & 0.800 & 0.875 \\ Precision & Low risk & 0.679 & 0.925 & 0.815 & 0.711 & 0.679 \\ Precision & Medium risk & 0.581 & 0.451 & 0.700 & 0.590 & 0.703 \\ Precision & High-risk & 1.000 & 1.000 & 1.000 & 0.964 & 0.9193 \\ Accuracy & - & 0.650 & 0.676 & 0.707 & 0.749 & 0.703 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Results of the 5-fold iterations. Figure 5: Representation of possible outcomes of the fitted model. As shown in Table 5, the low standard deviation (0.04) indicates the good stability of the model across iterations. The remaining 30% of observations fall in the other squares of Figure 5, for the observations of low risk misclassified by an over-estimation of the risk occurred (OLPM and OLPH), while, for the high-risk observation, an underestimation occurred (OHPL and OHPM). For the medium risk observation, both underestimation and overestimation are possible (OMPL, OMPH). The OLPH and the OHPL misclassifications are the most concerning ones and special attention was dedicated to interpreting the results. Considering the context of pedestrian safety, the OHPL error could put pedestrians at risk if this model was used to assess the risk level of a road section. Checking the recall and precision average values, a very high precision value (0.98) for the high-risk class can be observed, while the recall value for the same class is lower (0.71).