A Multidimensional Framework for Traffic Accident Conse-quence Prediction: Integrating Multi-objective Optimization, Explainable AI, and Causal Inference
Description
The data used in this study were obtained from the road traffic accident dataset of Yancheng City for the full year of 2022. The original dataset consists of road traffic ac-cident records, road environment and traffic facility attributes, and grid-scale point-of-interest (POI) data, which were spatially matched using accident location co-ordinates, road codes, and grid IDs. After data cleaning, a total of 4,237 valid observa-tions were obtained. The dataset was randomly divided into training and testing sets at a ratio of 80% and 20%, with the random seed set to 42. The final training set contained 3,389 observations, while the testing set contained 848 observations. Hyperparameter search and Voting ensemble weight optimization were conducted only within the training set, using three-fold cross-validation with random shuffling. The testing set was not involved in model tuning or ensemble weight determination and was used solely for the final evaluation of generalization performance.
Files
Steps to reproduce
1. Collect traffic accident records from Yancheng City (2022), including fatalities, injuries, and direct property loss. 2. Integrate multi-source data, including road infrastructure attributes, traffic control facilities, and surrounding POI data. 3. Perform data preprocessing: - Label encoding for categorical variables - Missing value imputation - RobustScaler normalization for features - log1p transformation for target variables 4. Split dataset into training and testing sets (80% / 20%, random seed = 42). 5. Train machine learning models: SVR, Random Forest, ANN, Extra Trees, XGBoost, LightGBM, and CatBoost. 6. Construct a weighted voting ensemble model and optimize hyperparameters using NSGA-II multi-objective optimization. 7. Evaluate model performance using RMSE, MAE, NRMSE, and Macro-F1 metrics. 8. Apply SHAP for feature importance interpretation, LOWESS for nonlinear effect analysis, and DirectLiNGAM for causal structure discovery.
Institutions
- Nanjing Forestry UniversityJiangsu, Nanjing