## 3 Methodology  
This paper aims to further classify the results of traffic accident prediction and address the common issue of sample imbalance in traffic accident data, which can potentially reduce the accuracy of model predictions. To tackle this challenge, we propose a traffic accident prediction model that integrates relief-F, MAHAKIL, mini batch K-means, and CatBoost. The primary objective is to mitigate the adverse impact of sample imbalance on model performance and more accurately identify the severity of traffic accidents.  
To evaluate the effectiveness of the ReMAHA-CatBoost model in the field of traffic accident prediction, we chose the US-Accidents dataset [31; 32] as the subject of our study. We initially conducted a series of data preprocessing steps, including missing values, handling duplicate values, outliers, one-hot encoding, and feature engineering. These stepsprovided critical data for predicting the severity of traffic accidents. Subsequently, we developed a hybrid sampling prediction model using the ReMAHA-CatBoost architecture. This model is designed to alleviate the data imbalance issue in traffic accidents and perform the classification task for the severity of traffic accidents.  
At the data-level, due to the strong randomness in traffic accident data, it is challenging to generate data using traditional oversampling methods. Therefore, we initially perform clustering on minority class samples, enhancing the similarity between samples. We then use MAHAKIL to generate new minority class samples between clusters. Furthermore, due to the presence of a considerable number of boolean features in traffic accident characteristics, feature sparsity can occur. When dealing with large datasets and extremely sparse features, computing the Mahalanobis distance becomes challenging as the covariance matrix might become non-invertible, thereby impeding the use of traditional Mahalanobis distance computation.  
We introduce the relief-F algorithm to process the features after clustering, which can eliminate near-uniform labels in the clusters and populate them after generating the data. Such processing avoids the influence of sparse features on the computation of the Mahalanobis distance. In addition, we use the obtained diagonal matrix of feature importance weights for Mahalanobis distance weighting. The purpose of this step is to optimize the traditional Mahalanobis distance which has the problem of exaggerating the role of small variables, and to improve the influence of important features on the distance.  
Despite the extensive volume of traffic accident data, which is highly advantageous for subsequent predictions. However, the internal data distribution is unbalanced, which leads to the problem of overfitting easily using traditional algorithms, making the prediction results biased towards categories with more samples. In this regard, we used CatBoost for prediction at the algorithm-level, which is used in order to mitigate the overfitting problem in the traffic accident classification task. CatBoost's ranking boost and overcoming gradient bias enhance the model's predictive capabilities on the imbalanced traffic accident dataset. Subsequent subsections will provide detailed explanations of the mentioned methods. The overall workflow of the proposed method is outlined in Figure 1, which will be elaborated in this section.