# Cause Analysis and Accident Classification of Road Traffic Accidents Based on Complex Networks
## 4 Case Studies
### Construction of an Injury Severity Classification Model for Road Traffic Accidents
#### 4.5.2 Model Construction and Analysis  
The machine learning methods used included Logistic Regression (LR), Random Forest (RF), Decision Tree (DT), and Extreme Gradient Boosting (XGBoost). The specific configuration of the machine learning model is shown in Table 4. The dataset was divided into a 75% training set and a 25% test set. A classification model of road traffic accident injury severity was constructed, and the ROC curves of the four methods were compared, as shown in Figure 10.  
As shown in Figure 10, it can be seen that the Extreme Gradient Boosting (XGBoost) curve is closer to the upper left corner than the other three model curves. It means that Extreme Gradient Boosting (XGBoost) has a larger AUC value, and its performance is also better than the other three methods. Therefore, the performance of Extreme Gradient Boosting (XGBoost) is superior to that of the other three models. The different indicators of the four models in different accident injury severities are shown in Figures 11-13 and Table 5. The sensitivity test is shown in Figure 14 below. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Model** & **Specific Configuration** & **Model** & **Specific Configuration** & \\ \hline \multirow{6}{*}{Logistic Regression (LR)} & Regularization type & L2 & \multicolumn{2}{c}{Number of trees} & 100 \\ \cline{2-5}  & Regularization intensity & 1 & \multicolumn{2}{c}{Node splitting rules} & Gini \\ \cline{2-5}  & Maximum number & \multicolumn{2}{c}{Random Forest} & Minimum number & \\  & of iterations & \multicolumn{2}{c}{(RF)} & of samples for leaf nodes & 1 \\ \cline{2-5}  & Iteration termination & \multicolumn{2}{c}{0.001} & \multicolumn{2}{c}{Minimum number of samples contained in internal nodes} & 2 \\ \cline{2-5}  & Optimizer & Ibfgs & \multicolumn{2}{c}{Evaluating indicator} & Mlogloss \\ \hline \multirow{6}{*}{Decision Tree (DT)} & Minimum number of samples contained in internal nodes & \multicolumn{2}{c}{Extreme Gradient Boosting (XGBoost)} & Learning rate & 0.3 \\ \cline{2-5}  & Node splitting rules & \multicolumn{2}{c}{Information entropy} & \multicolumn{2}{c}{Sampling ratio} & 1 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Specific configuration of machine learning models. Figure 10: ROC curves of the four models. Figure 11: Comparison of indicators of the four models in Ordinary accident conditions. Figure 12: Comparison of indicators of the four models in Serious accident conditions. Figure 14: Sensitivity test of the four models in different types of accidents. Figure 13: Comparison of indicators of the four models in Major accident conditions. From the above Figures 11-13, we can see that the precision rate, recall rate, and F1-score value of the four models are larger in Ordinary accidents and Serious accidents. The reason is that the number of Ordinary accidents and Serious accidents in the original data accounts for a large proportion. It can be seen that when considering the safety triggering factors, it is possible to focus on the influencing factors of both Ordinary and Serious accidents. From the sensitivity test in Figure 14, it can be seen that all four models can effectively and correctly classify accidents in Ordinary accidents. In Serious accidents, the classification performance of Extreme Gradient Boosting (XGBoost) and Random Forest (RF) is higher than that of Logistic Regression (LR) and Decision Tree (DT). In Major accidents, the classification performance of the four models for accidents is relatively low, due to the small amount of data for Major accidents and the insufficient learning depth of the models for various features. From Table 5 it can also be found that the evaluation index values of the Logistic Regression (LR) model in different types of accidents are lower than those of the other three models, indicating that the classification performance of the Logistic Regression (LR) model is poorer than that of the other three models.