## 5 Discussion  
Crash frequency modeling has long been recognized as a complex challenge, particularly when dealing with zero-inflated datasets where a significant proportion of road segments report no crashes. Historically, traditional statistical models, such as the Poisson and negative binomial models, have been the go-to methods for handling crash frequency data. However, these models often struggle with overdispersion and an excess of zeros, leading to less accurate predictions and difficulties in identifying the underlying risk factors. In response to these limitations, data-driven approaches based on machine learning  
Figure 9: SHAP PDP plots for selected variables. have emerged as powerful alternatives. Machine learning models can capture complex, non-linear relationships in data, offering potential improvements in prediction accuracy and interpretability. In this study, we proposed a novel machine learning-based hurdle model to analyze crash frequency data, addressing the limitations of traditional models. The framework consists of two stages: a classification stage to predict the occurrence likelihood of crashes, and a regression stage to estimate the frequency of crashes for segments where crashes occur. The results from the classification stage indicate that the CatBoost model, particularly when enhanced with custom loss functions, significantly outperformed traditional models. The precision and recall scores were particularly noteworthy, demonstrating the model's capability to handle imbalanced data and accurately predict the likelihood of crashes. This stage demonstrated a clear advantage in handling zero-inflated data while ensuring high sensitivity to crash occurrences, an essential feature for effective road safety interventions. In the regression stage, where the task was to predict the number of crashes for segments where they occurred, the CatBoost model again outperformed traditional count-based models like the zero-truncated Poisson and negative binomial models. By utilizing a Poisson loss function, the CatBoost model more effectively captured the count nature of crash data, leading to lower RMSE and MAE values. These results underscore the flexibility of the proposed machine learning framework in adapting to the unique challenges posed by crash frequency data, particularly in handling overdispersion and non-linear relationships between predictors. The full model evaluation further solidified the superiority of the proposed two-stage approach. When compared to benchmark models, such as the Poisson hurdle and negative binomial hurdle models, the proposed model achieved the lowest RMSE and MAE values. This demonstrates its enhanced accuracy and ability to generalize well to different road segments, providing a reliable tool for road safety analysis. To provide further insights into the model's decision-making process, SHapley Additive exPlanations (SHAP) was employed. SHAP helped to interpret the model outputs by quantifying the contribution of individual variables to the predictions. While SHAP does not provide numerical coefficients like traditional statistical models, it offers a more flexible interpretation of variables' importance. Features such as road curvature, traffic volume (AADT), and segment length were identified as critical drivers of crash risk, which is consistent with the established road safety literature. This interpretability is crucial for practitioners, as it enables them to make informed decisions about which road segments require safety interventions. Although SHAP does not generate numerical metrics comparable to traditional regression coefficients, it offers significant advantages in explaining complex machine learning models. The insights gained from SHAP can be used to develop targeted safety interventions, as it highlights the most influential risk factors across various road segments. Despite these improvements, certain limitations must be acknowledged.