# Predicting Road Traffic Collisions Using a Two-Layer Ensemble Machine Learning Algorithm
## 5 Conclusions  
In this paper, we propose a two-layer ensemble model for predicting road traffic collisions. The two-layer ensemble method employed was created by combining the outputs of k-NN, DT, AdaBoost, NB, and logistic regression as a meta-classifier in the two levels. The models were compared in terms of accuracy, precision, recall, and F1 score. With the unique combination of the ML classifiers, the two-layer ensemble method achieved a remarkable accuracy of 88% in a 10-fold cross-validation, with precision at 86%, recall at 83%, and F1 score at 84%. Since traffic collisions are random, a model that can predict road traffic collisions in a timely manner by using a few input features is required. In practice, crash prediction is an important aspect for emergency services and trauma centers to estimate the potential risks resulting from collisions and accordingly equip the centers and other units with appropriate post-crash care equipment. For policy makers, the findings of this research can be implemented to formulate evidence-based policies, as opposed to the cause-and-effect approach that is common in most low- and middle-income countries. The two-layer ensemble model can then be used to predict road collisions and \begin{table}
\begin{tabular}{l l l l l l l} \hline \hline
**Work** & **Dataset Source** & **Method** & **Precision** & **Recall** & **F1-Score** & **Accuracy** \\ \hline \multirow{4}{*}{\begin{tabular}{l} [PERSON] \\ et al. [44] \\ \end{tabular} } & \multirow{4}{*}{Collected} & Ensemble & \multirow{4}{*}{94\%} & \multirow{4}{*}{94\%} & \multirow{4}{*}{94\%} & \multirow{4}{*}{94\%} \\  & & XGBoost & & & & & \\  & & RF & & 91\% & 90\% & 90\% & 90\% \\  & & LR & & 65\% & 65\% & 65\% \\ \hline \multirow{4}{*}{\begin{tabular}{l} [PERSON] et al. [45] \\ (ARDD) \\ \end{tabular} } & Australia road & \multirow{4}{*}{\begin{tabular}{l} Ensemble \\ SVM \\ k-NN \\ DT \\ \end{tabular} } & \multirow{4}{*}{\begin{tabular}{l} \\ 88\% \\ 87\% \\ 88\% \\ \end{tabular} } \\  & & \begin{tabular}{l} Classification \\ DT \\ Gradient boosting decision tree \\ (GBDT) \\ \end{tabular} & & & & & 77\% \\ \hline \multirow{4}{*}{\
\begin{tabular}{l} [PERSON] \\ et al. [43] \\ \end{tabular} } & \multirow{4}{*}{Canadian Dataset} & Ensemble & \multirow{4}{*}{70\%} & \multirow{4}{*}{66\%} & \multirow{4}{*}{67\%} \\  & & k-NN & & & & \\ \cline{1-1}  & & DT & 68\% & 70\% & 69\% & 69\% \\ \cline{1-1}  & & AdaBoost & 72\% & 72\% & 72\% & 71\% \\ \cline{1-1}  & & FNN & 70\% & 70\% & 70\% & 69\% \\ \cline{1-1}  & & SVM & 72\% & 69\% & 71\% & 68\% \\ \cline{1-1}  & & Two-Layer Ensemble & 73\% & 77\% & 75\% & 76\% \\ \hline \multirow{4}{*}{
\begin{tabular}{l} Proposed \\ \end{tabular} } & \multirow{4}{*}{Driving Simulator} & Ensemble & \multirow{4}{*}{56\%} & \multirow{4}{*}{56\%} & \multirow{4}{*}{56\%} & \multirow{4}{*}{65\%} \\  & & k-NN & & & & \\ \cline{1-1}  & & DT & & & & \\ \cline{1-1}  & & AdaBoost & 76\% & 71\% & 72\% & 79\% \\ \cline{1-1}  & & NB & 83\% & 76\% & 77\% & 81\% \\ \cline{1-1}  & & Two-Layer Ensemble & 86\% & 83\% & 84\% & 88\% \\ \hline \hline \end{tabular}
\end{table} 
Table 8: Comparison of the proposed two-layer ensemble model with works in the literature. therefore save lives and prevent socioeconomic losses. Through validation, the proposed two-layer ensemble had the highest accuracy. One limitation of the proposed approach is the time it takes to run the model, which can be comparatively longer than individual models. Additionally, the dataset in this study was imbalanced; therefore, we applied SMOTE resampling strategy, although other advanced approaches could have been used to solve the issue of an imbalanced dataset. The dataset in this study was based on simulated crash data. We highly advocate for a common road collision data collection format to be used by traffic and policy enforcers worldwide.