A Multi-Dimensional Feature Analysis Method for Traffic Delay at Urban Traffic Accident Locations
By constructing a multi-dimensional feature analysis system based on a random parameter Logit model and a machine learning model, the problem of analyzing the degree of driving delay at urban traffic accident sites was solved, influencing factors were identified, traffic management was optimized, and traffic congestion and secondary accidents were reduced.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ZHEJIANG UNIV
- Filing Date
- 2024-12-23
- Publication Date
- 2026-05-26
Smart Images

Figure CN119964359B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of traffic safety analysis technology, and in particular to a multi-dimensional feature analysis system for the degree of driving delay at urban traffic accident sites. Background Technology
[0002] Traffic accidents not only cause property damage and injuries, but also trigger problems such as lane encroachment, significant speed differences between upstream and downstream vehicles, and complex driving behaviors when vehicles enter and exit the accident site. These issues can lead to sporadic traffic congestion, delays, and reduced road capacity and operational management. Delays at accident sites further increase the likelihood of secondary accidents on the same road segment, making it necessary to analyze the impact of urban traffic accidents on delays at accident sites. By mining the potential information and distribution patterns in traffic data, we can explore the correlation between traffic accidents, their duration, delays, and various influencing factors. In real-world scenarios, many factors are involved in delays at accident sites, requiring large-scale traffic data that includes multiple influencing factors for effective analysis.
[0003] In traffic big data model analysis, due to the development of computer technology, traffic big data processing is more efficient and faster; the models are also more diversified, and can utilize statistical models such as Logit with random parameters, machine learning models such as random forests, and SHAP analysis models, increasing the feasibility of individual and group-level research on a large number of features, as well as the analysis of data heterogeneity and transferability. Summary of the Invention
[0004] To achieve the above objectives, the present invention provides the following technical solution:
[0005] This invention provides a multi-dimensional feature analysis system for the degree of driving delay at urban traffic accident sites. The analysis system includes:
[0006] The preprocessing module is used to preprocess the dataset of traffic delay levels at urban accident locations;
[0007] Based on the stochastic parametric logit model (RPLHM) considering mean heterogeneity, this study analyzes the individual heterogeneity of driving delays at urban traffic accident sites. This involves identifying the differences or instabilities of influencing factors across different samples, and how variations in some sample characteristics lead to inconsistent effects of the same factor on different samples. The study identifies individual heterogeneous variables and the sample characteristics that contribute to this heterogeneity. The influencing factor analysis combines average marginal effect values to analyze variables that significantly affect driving delays and their differences in impact across four dimensions: road, weather, point of interest, and time.
[0008] The Logit model based on stochastic parameters (RPLHM) combines with transferability theory to conduct global and local transferability analysis of artificially divided groups, namely, whether the influence mechanisms of two groups are similar, and whether the model of a single group can maintain good performance on the data of another group; the overall dataset is divided into day / night and weekday / restday, and the consistency or difference of the influencing factors of driving delay between groups is detected.
[0009] A two-layer model combining latent categories and machine learning is used to identify, predict, and analyze heterogeneous groups of traffic delays at urban accident sites. Group identification clarifies the optimal scenario for classifying heterogeneous groups; delay prediction selects the best machine learning model to predict the delay level of heterogeneous groups; and group heterogeneity analysis combines the SHAP model to interpret and analyze the global importance of different features in heterogeneous groups.
[0010] Furthermore, the specific analysis steps for the preprocessing model are as follows:
[0011] (11) Based on the duration of the delay, the dependent variable of the degree of traffic delay is divided into minor delay, severe delay and extreme delay. Factors that have no explanatory significance and are lag variables of the accident are initially excluded, including variables such as the end time of the accident and the latitude and longitude of the start and end.
[0012] (12) Based on the accident description field and the location of the city road, extract the road condition, road type and road segment feature information at the time of the accident to obtain derived variables including four categories: road condition, road type, peak time and season;
[0013] (13) Based on the statistical distribution characteristics, delete the characteristics of wind chill temperature and rainfall variables with excessively high data loss rate and similar meanings to other variables; calculate the variance values of all variables and delete variables with a variance of 0, that is, variables with a single distribution and no distinguishing power, including speed bumps, yield signs, roundabouts, turning loops, traffic lights and deceleration; fill in the weather conditions, wind direction, air pressure, visibility, relative humidity, humidity and wind speed.
[0014] (14) Discretize and bin the variables of temperature, visibility and wind speed, and convert all subcategories of weather conditions, wind direction, peak period, season, temperature, visibility and wind speed into independent binary classification features, and use 0 and 1 to represent binary state variables.
[0015] (15) Based on the tolerance and variance inflation factor indices of the regression model, collinearity diagnosis is performed on all variables in the road dimension, point of interest (POI) dimension, weather dimension and time dimension to avoid the impact of excessively high collinearity level on the significance level and convergence of the model. The evaluation index is tolerance and variance inflation factor (VIF).
[0016] Tolerance is calculated as follows:
[0017]
[0018] In the formula, To make the first One variable representing the degree of delay was taken as the dependent variable, and the remaining... k -1 variables are used as independent variables to establish the determination coefficient of the linear regression model; the tolerance value ranges from 0 to 1, and the closer it is to 1, the lower the degree of multicollinearity among the independent variables; it is generally believed that when the tolerance is greater than 0.1, there is no multicollinearity among the variables, and this paper also selects 0.1 as the indicator.
[0019] Variance inflation factor (Variance inflation factor) VIF This reflects whether there is multicollinearity among the observed values of the independent variable, and is calculated as follows:
[0020]
[0021] In the formula, VIF The variable is the reciprocal of tolerance. of and Showing a positive correlation, The larger the value, the stronger the correlation between the variable and other variables. The criteria for judging collinearity are:
[0022] ①
[0023] ②
[0024] When criterion ① is met, it indicates that there is multicollinearity among the variables; when both criterion ① and criterion ② are met, it indicates that the data has severe multicollinearity.
[0025] Furthermore, in step (13), the method for filling in the weather conditions, wind direction, air pressure, visibility, relative humidity, humidity, and wind speed is as follows:
[0026] For weather conditions and wind direction variables, missing values were filled using cold platform data and the mode.
[0027] For variables such as air pressure, visibility, temperature, relative humidity, and wind speed, regression predictions were performed using the Missforest multiple imputation method based on a random forest model. The specific steps for imputation are as follows:
[0028] First, combine the P variables to be filled, each with a data quantity of n, into of For dimensional data, use the mode or mean to initially fill in the gaps;
[0029] Secondly, sort the variables with missing values according to their missing values and select the variable with the smallest missing value. As the primary filler variable;
[0030] Furthermore, using variables As predictor variables, the remaining variables are used as feature variables, and are categorized according to whether they contain missing values. Observations , missing values , Other observations and Other observations besides the missing values ;
[0031] Finally, and Input it into the random forest model for training, and utilize Predicting missing data from data ;
[0032] During multiple iterations of the random forest model, when the latest filling result differs from the previous filling result... X’ s Calculation stops when the value approaches 0, indicating that missing values have been filled.
[0033]
[0034] In the formula, and They represent The latest and last completed datasets for the variable.
[0035] Furthermore, in step (14), all subcategories of weather conditions, wind direction, peak hours, season, temperature, visibility, and wind speed are converted into independent binary classification features. The method is as follows:
[0036] A multi-category variable is divided into total When a single subcategorical variable is used, a certain subclass Set as a reference variable, it will not be included in the scope of modeling variables. Then, the state of the binary variable is represented by 0 and 1; a value of 1 indicates that the variable state exists. Furthermore, in multi-category variables, if a certain subclass... When used as a reference variable, if the value of other subclasses is 0, The indicated state is valid.
[0037] Furthermore, in step (15), the evaluation index for collinearity diagnosis is tolerance and variance inflation factor (VIF).
[0038] Tolerance is calculated as follows:
[0039]
[0040] In the formula, To make the first One variable representing the degree of delay was taken as the dependent variable, and the remaining... k -1 variables were used as independent variables to establish the determination coefficient of the linear regression model; the tolerance value ranged from 0 to 1, and the closer it was to 1, the lower the degree of multicollinearity among the independent variables; it is generally believed that when the tolerance is greater than 0.1, there is no multicollinearity among the variables, and this paper also selects 0.1 as the indicator;
[0041] Variance inflation factor (Variance inflation factor) VIF This reflects whether there is multicollinearity among the observed values of the independent variable, and is calculated as follows:
[0042]
[0043] In the formula, VIF The variable is the reciprocal of tolerance. of and Showing a positive correlation, The larger the value, the stronger the correlation between this variable and other variables;
[0044] The criteria for determining collinearity are:
[0045] ①
[0046] ②
[0047] When criterion ① is met, it indicates that there is multicollinearity among the variables; when both criterion ① and criterion ② are met, it indicates that the data has severe multicollinearity.
[0048] Furthermore, the specific analysis steps based on the stochastic parameter Logit model considering mean heterogeneity are as follows:
[0049] (21) The Monte Carlo method was adopted, and slight delay was selected as the reference delay level for establishing the random parameter Logit model. First, the multinomial logit model (MNL) was adopted, and 0.01 was selected as the critical significance level of the parameter. The stepwise backward method was used to eliminate insignificant variables one by one to complete the model calibration.
[0050] Specifically: The MNL model is a traditional Logit model, which assumes that the random terms are independent and follow an extreme value type I distribution, with the utility function being:
[0051]
[0052] In the formula, Indicates the first n A vector of factors influencing delay data in each sample; To estimate the parameter vector; This is the error term;
[0053] From the above equation, the density function formula for the MNL model is:
[0054]
[0055] Because the traditional Logit model does not consider the effects of various factors on different levels of travel delay, it suffers from heterogeneity across different data samples. Add random items At this point, the estimated parameter vector is expressed as:
[0056]
[0057] In the formula, For fixed parameters, This represents the coefficient matrix, i.e., the covariance of random parameters and latent correlations. Represents a random term with zero mean and covariance matrix equal to the identity matrix; estimates the parameter vector. It is represented as a linear combination of fixed parameters and random terms;
[0058] The multinomial Logit model further evolved into the stochastic parameter Logit model (RPLHM).
[0059] (22) Substitute significant variables into the RPL model to identify and estimate random parameters; select Halton sampling method for sampling the sample, assume all variables are random parameters, and perform parameter distribution calibration in the form of normal distribution and binomial; retain significant random parameter variables, and set those with significance above the threshold as fixed parameters;
[0060] (23) Given the significant parameters of the RPL model, calibrate the random parameter Logit model (RPLHM); maintain the random parameter state of the heterogeneous variables, assume that all fixed parameters are heterogeneous variables with mean, and calibrate the parameters in turn; variables that pass the significance test are calibrated as explanatory variables of random parameters, and those that do not pass the significance test remain as fixed parameters;
[0061] (24) Combine the average marginal effect index to quantitatively analyze the impact of four dimensions of factors—road, weather, POI (point of interest), and time—on the probability of minor, severe, and extreme driving delays;
[0062] The average marginal effect refers to the average change in the probability of a certain degree of traffic delay caused by a one-unit change in a particular influencing factor, while keeping other variables constant. The formula for calculating the average marginal effect differs depending on whether the influencing factor is a continuous or categorical variable.
[0063] In continuous variables, the average marginal effect is the partial derivative of the probability function with respect to the independent variable, and its marginal benefit is calculated as follows:
[0064]
[0065] In the formula, For the first Factors affecting the severity of delays The average marginal utility; For the sample size, For the first One sample data; For the first m A probability function with each variable as an independent variable; Indicates that the independent variable is the first... One variable; Therefore, the first A probability function of nth sample where each variable is an independent variable; These are tiny differences or increments used for numerical simulation of partial derivatives;
[0066] In binary categorical variables, the average marginal effect is the change in the predicted probability of travel delay as the binary variable changes from 0 to 1, and the calculation formula is shown below:
[0067]
[0068] In the formula, For the first n The data sample number m One factor variable The probability of the severity j of the traffic delay caused by the time; For the first n The data sample number m One factor variable The severity of traffic delays caused by time j The probability of.
[0069] Furthermore, the specific analytical steps for the Logit model based on stochastic parameters and the theory of transferability are as follows:
[0070] (31) Divide all sample data into two groups: daytime / nighttime and weekday / weekend;
[0071] (32) Calculate the first log-likelihood ratio test, with a critical confidence level of 95.00%, to test whether there is transferability of influencing factors between the overall traffic delay data and the subgroups; the subgroups include daytime, nighttime, weekdays and weekends.
[0072] The test statistic follows a chi-square distribution, and the formula for the log-likelihood ratio test is shown below:
[0073]
[0074] In the formula, The chi-square value, This represents the log-likelihood ratio at which the model converges when modeling based on delay data caused by traffic accidents from the overall sample. and Subgroups and subgroups The log-likelihood ratio at the convergence point of traffic delay data modeling;
[0075] (33) Calculate the second log-likelihood ratio test, with 95.00% as the critical confidence level, to compare the local transferability of influencing factors between day and night, and between weekdays and weekends, and to analyze the stability of parameter estimation.
[0076] The test statistic for this group follows a chi-square distribution, and the calculation formula is shown below:
[0077]
[0078] In the formula, The chi-square value, LL(β ci,cj ) Indicates the user group Traffic delay severity model for groups The log-likelihood function value obtained when modeling traffic data converges; For the user group The log-likelihood function value at convergence of traffic delay data modeling;
[0079] (34) Compare the influencing factors, parameter estimation coefficients, signs, and average marginal effects of different groups. Assume that variables with a current significance probability lower than the significance level of 0.01 are significant variables, and divide them into the following three cases: ① Significant in one group and not significant in another; ② The same variable is significant in both weekday and weekend or daytime and nighttime groups, but the effects of parameter estimation coefficient signs and average marginal effects are opposite; ③ The same variable is significant in both groups, and the effects of parameter estimation coefficient signs and average marginal effects are the same. Conduct a difference study on the weekday / weekend and daytime / nighttime groups.
[0080] Furthermore, the specific analysis steps for the latent category and machine learning two-layer model are as follows:
[0081] (41) Establish a latent category model to identify heterogeneous groups, calculate three types of fitting indices (AIC, BIC, SSA-BIC) and three types of significance indices (entropy, LMRT, BLRT) to determine the optimal number of clusters and classify heterogeneous groups;
[0082] Assuming the latent class Logit model has Potential categories, in Under the category, the severity of travel delays is as follows: The conditional probability of the nth event occurring is as follows:
[0083]
[0084] In the formula, This represents the error term, which is a constant. Indicating accident samples In China, the severity of traffic delays The set of influencing factors; for Traffic delay severity by category The vector of independent variable parameters; Indicates in Traffic delay level under category The The incident, The transpose operator for the parameter vector;
[0085] No. The sample of driving delays after a traffic accident belongs to k The probability calculation for each category is as follows:
[0086]
[0087] In the formula, Belongs to k The set of influencing factors in the category; These are the corresponding influencing factor variables;
[0088] Combining the above formula, the severity of traffic delays caused by traffic accidents is: The formula for calculating the total probability of the nth accident is as follows:
[0089]
[0090] Based on the above formula, the maximum likelihood method is used to estimate the parameters of the latent class Logit model, and finally the cluster probability corresponding to each driving delay sample is obtained, and the cluster category is automatically divided.
[0091] The latent category model metrics are as follows:
[0092] 1) The Akaike Information Criterion (AIC) is a weighted function of the log-likelihood function value and the number of parameters. The calculation formula is shown below:
[0093]
[0094] In the formula, E The AIC index represents the number of free parameters for model convergence. The smaller the value of the AIC index, the better the model fits.
[0095] 2) Bayesian Information Criterion (BIC)
[0096] Consider the number of samples to prevent excessive complexity and overfitting caused by excessively high model accuracy.
[0097] The calculation formula is as follows:
[0098]
[0099] 3) Sample correction The calculation formula is as follows:
[0100]
[0101] In the formula, The number of model parameter estimates; This is the log-likelihood value at which the latent class model converges; The sample size is the total number of sample data points for traffic delay data. This represents the sample size for the corrected traffic delay data; The smaller the value, the better the model fits the data.
[0102] 4) Entropy ( )
[0103] Entropy is often used to measure the optimal number of clusters, and the calculation formula is shown below:
[0104]
[0105] In the formula, This indicates the number of clusters selected, where N is the total number of samples of traffic delays caused by traffic accidents. For the first Traffic delay data caused by traffic accidents belongs to the cluster. q The posterior probability value; the entropy value is between 0 and 1, and the larger the value, the more accurate the cluster number;
[0106] 5) Likelihood ratio test ( ) and Bootstrap-based likelihood ratio test ( )
[0107] and Used for comparison One and The fit difference between the models of each category; when the significance probabilities of two parameters are significant, then the current The latent class model for each category has a better fit than... The model performance of each category; conversely, a preference is given to choosing... The classification results of the latent class model for each category;
[0108] (42) Use the SmoteEnn algorithm to balance the data, and sort the feature importance output by the XGboost algorithm in descending order; for the sorted features, gradually reduce the number of features at 10% intervals and train the model, determine the optimal feature ratio for different heterogeneous groups based on the accuracy of the XGboost model, and screen redundant feature variables.
[0109] (43) Based on the feature quantity screening, the degree of driving delay at the location of urban traffic accidents is used as the dependent variable. Four models, namely Random Forest, XGBoost, LightGBM and CatBoost, are used to model and predict the heterogeneous population. The hyperparameters of the above models are adjusted by using a Bayesian model based on tree structure probability density and cross-validation.
[0110] (44) Finally, the model performance was evaluated using the accuracy and F1 score metrics, and models suitable for each heterogeneous population were selected. The metrics included accuracy, precision, and recall.
[0111] (45) Combine the SHAP method to calculate the absolute SHAP value of different features, and analyze their global importance to features in different groups and their influence on single and interactive features in different heterogeneous groups.
[0112] SHAP is a game theory-based framework for explaining the input-output mechanism of machine learning models, and it can be combined with different machine learning models for interpretation. SHAP calculates the feature-assigned shap value for the prediction results of a single sample, and can further use the sum of the shap values of each feature to interpret the model's predictions.
[0113] Specifically:
[0114] First, the Shapley value needs to be calculated. Considering the non-independence between features, SHAP calculates a weighted average of possible feature combinations to obtain the feature value. The final attribution value is calculated using the formula shown below:
[0115]
[0116] In the formula, For the set of all features, For set A subset that does not contain features Features are extracted by training two models. SHAP value, Indicates the use of inclusion features The model trained on a subset of the dataset. Representing a feature subset The trained model, and , where is the expected value of the function of the input features;
[0117] Secondly, based on the excellent properties of SHAP in terms of local accuracy, missing data, and consistency, the predicted values of the machine learning model with the highest prediction accuracy are obtained. The calculation formula explained is:
[0118]
[0119] In the formula, To explain the model, The state indicating whether a feature has been observed. express The dimension of the feature space, i.e., the size of the feature space, is such that if a feature is not observed, then... M represents the total number of features. Predict the mean for all samples. Features The attribution value.
[0120] Furthermore, in step (43), the Bayesian hyperparameter optimization (TPE-BO) adjustment model based on tree structure probability density includes Bayesian optimization (BO) and tree structure probability density estimation (TPE).
[0121] Bayesian optimization finds the optimal parameter combination by finding the maximum or minimum value of the objective function, as shown in the formula:
[0122]
[0123] In the formula, To obtain the optimal hyperparameters, For parameter space, The objective function is...
[0124] Bayesian optimization is achieved using a probability distribution model and a data acquisition function. The solution is also distinguished by the differences between these two parts among different Bayesian optimization models. The former is a model built using existing historical parameter tuning data; the latter provides a reference for the selection of hyperparameter combinations, continuously introducing new combinations into the probability distribution model and iterating to the maximum number of times.
[0125] In the Bayesian optimization model, the acquisition function considers both exploring unknown regions and existing regions, and takes the form of maximizing expected improvement (EI), as shown in the following equation:
[0126]
[0127] In the formula, , which is the optimal value of the observation threshold; For the input variables, The predicted input value for the objective function; This represents the expected improvement, specifically the anticipated improvement in value y at point x. It is the data acquisition function;
[0128] Tree structure probability density estimation (TPE), as a probabilistic surrogate model, differs primarily in its acquisition function. The solution; according to Bayes' theorem, the conditional probability can be calculated using the formula:
[0129]
[0130] In the formula, For input variables, The objective function value, Input variables The prior probability, For target value marginal distribution Input variables The posterior probability;
[0131] TPE probabilistic proxy model takes into account High computational cost, through and Solution:
[0132]
[0133]
[0134] In the formula, For observations The expected loss function is greater than Density estimation;
[0135] For the density estimate of the remaining observations; Selected in the TPE algorithm As part of the observations quantile values;
[0136] From the above equation, the final maximum expected improvement EI can be obtained as:
[0137]
[0138] As can be seen from the above equation, the TPE-BO model does not require... Modeling, and the optimization process only applies to The optimal combination of hyperparameters is obtained through evaluation.
[0139] The present invention has the following beneficial effects:
[0140] This invention extracts road-dimensional features at the time of accidents based on urban traffic accident location delay data. Combining the characteristics of missing features, it proposes targeted data imputation schemes. Based on statistical distribution, redundant features are filtered, and structured traffic modeling data with four dimensions—weather, road, POI, and time—is constructed. The invention systematically models and analyzes the degree of traffic delay caused by urban traffic accidents from three aspects: individual heterogeneity, group transferability, and group heterogeneity. It explores the influence of significant variables among multi-dimensional influencing factors, aiming to help traffic management departments take preventative measures and emergency response strategies, provide a theoretical basis for road design optimization and management decisions, thereby mitigating the impact of traffic accidents, improving the operational risk level of accident-prone road sections, avoiding secondary accidents, and reducing traffic pollution. Attached Figure Description
[0141] Figure 1 This is a schematic diagram illustrating the analysis of the present invention. Detailed Implementation
[0142] The specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be noted that the embodiments are only specific illustrations of the invention and should not be regarded as limitations on the invention. The purpose of the embodiments is to enable those skilled in the art to better understand and reproduce the technical solution of the present invention. The scope of protection of the present invention should still be determined by the scope defined in the claims.
[0143] This invention extracts road dimension features at the time of the accident based on urban traffic accident location delay data, proposes targeted data imputation schemes based on the characteristics of missing features, and completes the screening of redundant features according to statistical distribution, thus constructing structured traffic modeling data with four dimensions of features: weather, road, POI, and time.
[0144] like Figure 1 As shown, this invention provides a multi-dimensional feature analysis system for the degree of driving delay at urban traffic accident sites. The analysis system includes:
[0145] The preprocessing module is used to preprocess the dataset of traffic delay levels at urban accident locations;
[0146] The specific analysis steps are as follows:
[0147] (11) Based on the duration of the delay, the dependent variable of the degree of traffic delay is divided into minor delay, severe delay and extreme delay. Factors that have no explanatory significance and are lag variables of the accident are initially excluded, including variables such as the end time of the accident and the latitude and longitude of the start and end.
[0148] (12) Based on the accident description field and the location of the city road, extract the road condition, road type and road segment feature information at the time of the accident to obtain derived variables including four categories: road condition, road type, peak time and season;
[0149] (13) Based on the statistical distribution characteristics, delete the characteristics of wind chill temperature and rainfall variables with excessively high data loss rate and similar meanings to other variables; calculate the variance values of all variables and delete variables with a variance of 0, that is, variables with a single distribution and no distinguishing ability, including speed bumps, roundabouts, turning loops, traffic lights and deceleration; fill in the weather conditions, wind direction, air pressure, visibility, relative humidity, humidity and wind speed;
[0150] The method for filling in weather conditions, wind direction, air pressure, visibility, relative humidity, humidity, and wind speed is as follows:
[0151] For weather conditions and wind direction variables, missing values were filled using cold platform data and the mode.
[0152] For variables such as air pressure, visibility, temperature, relative humidity, and wind speed, regression predictions were performed using the Missforest multiple imputation method based on a random forest model. The specific steps for imputation are as follows:
[0153] First, combine the P variables to be filled, each with a data quantity of n, into of For dimensional data, use the mode or mean to initially fill in the gaps;
[0154] Secondly, sort the variables with missing values according to their missing values and select the variable with the smallest missing value. As the primary filler variable;
[0155] Furthermore, using variables As predictor variables, the remaining variables are used as feature variables, and are categorized according to whether they contain missing values. Observations , missing values , Other observations and Other observations besides the missing values ;
[0156] Finally, and Input it into the random forest model for training, and utilize Predicting missing data from data ;
[0157] During multiple iterations of the random forest model, when the latest filling result differs from the previous filling result... Calculation stops when the value approaches 0, indicating that missing values have been filled.
[0158]
[0159] In the formula, and They represent The latest and last completed datasets for the variable.
[0160] (14) Discretize and bin the variables of temperature, visibility and wind speed, and convert all subcategories of weather conditions, wind direction, peak period, season, temperature, visibility and wind speed into independent binary classification features, and use 0 and 1 to represent binary state variables.
[0161] The method for converting all subcategories of weather conditions, wind direction, peak hours, season, temperature, visibility, and wind speed into independent binary classification features is as follows:
[0162] A multi-category variable is divided into total When a single subcategorical variable is used, a certain subclass Set as a reference variable, it will not be included in the scope of modeling variables. Then, the state of the binary variable is represented by 0 and 1; a value of 1 indicates that the variable state exists. Furthermore, in multi-category variables, if a certain subclass... When used as a reference variable, if the value of other subclasses is 0, The indicated state is valid.
[0163] (15) Based on the tolerance and variance inflation factor indices of the regression model, collinearity diagnosis is performed on all variables in the road dimension, point of interest (POI) dimension, weather dimension and time dimension to avoid the impact of excessively high collinearity level on the significance level and convergence of the model. The evaluation index is tolerance and variance inflation factor (VIF).
[0164] Tolerance is calculated as follows:
[0165]
[0166] In the formula, To make the first One variable representing the degree of delay was taken as the dependent variable, and the remaining... k -1 variables are used as independent variables to establish the determination coefficient of the linear regression model; the tolerance value ranges from 0 to 1, and the closer it is to 1, the lower the degree of multicollinearity among the independent variables; it is generally believed that when the tolerance is greater than 0.1, there is no multicollinearity among the variables, and this paper also selects 0.1 as the indicator.
[0167] Variance inflation factor (Variance inflation factor) VIF This reflects whether there is multicollinearity among the observed values of the independent variable, and is calculated as follows:
[0168]
[0169] In the formula, VIF The variable is the reciprocal of tolerance. of and Showing a positive correlation, The larger the value, the stronger the correlation between the variable and other variables. The criteria for judging collinearity are:
[0170] ①
[0171] ②
[0172] When criterion ① is met, it indicates that there is multicollinearity among the variables; when both criterion ① and criterion ② are met, it indicates that the data has severe multicollinearity.
[0173] Based on the stochastic parametric logit model (RPLHM) considering mean heterogeneity, this study analyzes the individual heterogeneity of driving delays at urban traffic accident sites. Specifically, it examines the differences or instabilities of influencing factors across different samples, highlighting how variations in some sample characteristics lead to inconsistent effects of the same factor on different samples. The study identifies individual heterogeneous variables and the sample characteristics that contribute to this heterogeneity. The analysis of influencing factors, combining average marginal effect values, examines variables that significantly impact driving delays and their differences in impact across four dimensions: road, weather, point of interest, and time.
[0174] The specific analysis steps are as follows:
[0175] (21) The Monte Carlo method was adopted, and slight delay was selected as the reference delay level for establishing the random parameter Logit model. First, the multinomial logit model (MNL) was adopted, and 0.01 was selected as the critical significance level of the parameter. The stepwise backward method was used to eliminate insignificant variables one by one to complete the model calibration.
[0176] Specifically: The MNL model is a traditional Logit model, which assumes that the random terms are independent and follow an extreme value type I distribution, with the utility function being:
[0177]
[0178] In the formula, Indicates the first n A vector of factors influencing delay data in each sample; To estimate the parameter vector; This is the error term;
[0179] From the above equation, the density function formula for the MNL model is:
[0180]
[0181] Because the traditional Logit model does not consider the effects of various factors on different levels of travel delay, it suffers from heterogeneity across different data samples. Add random items At this point, the estimated parameter vector is expressed as:
[0182]
[0183] In the formula, For fixed parameters, This represents the coefficient matrix, i.e., the covariance of random parameters and latent correlations. Represents a random term with zero mean and covariance matrix equal to the identity matrix; estimates the parameter vector. It is represented as a linear combination of fixed parameters and random terms;
[0184] The multinomial Logit model further evolved into the stochastic parameter Logit model (RPLHM).
[0185] (22) Substitute significant variables into the RPL model to identify and estimate random parameters; select Halton sampling method for sampling the sample, assume all variables are random parameters, and perform parameter distribution calibration in the form of normal distribution and binomial; retain significant random parameter variables, and set those with significance above the threshold as fixed parameters;
[0186] (23) Given the significant parameters of the RPL model, calibrate the random parameter Logit model (RPLHM); maintain the random parameter state of the heterogeneous variables, assume that all fixed parameters are heterogeneous variables with mean, and calibrate the parameters in turn; variables that pass the significance test are calibrated as explanatory variables of random parameters, and those that do not pass the significance test remain as fixed parameters;
[0187] (24) Combine the average marginal effect index to quantitatively analyze the impact of four dimensions of factors—road, weather, POI (point of interest), and time—on the probability of minor, severe, and extreme driving delays;
[0188] The average marginal effect refers to the average change in the probability of a certain degree of traffic delay caused by a one-unit change in a particular influencing factor, while keeping other variables constant. The formula for calculating the average marginal effect differs depending on whether the influencing factor is a continuous or categorical variable.
[0189] In continuous variables, the average marginal effect is the partial derivative of the probability function with respect to the independent variable, and its marginal benefit is calculated as follows:
[0190]
[0191] In the formula, For the first Factors affecting the severity of delays The average marginal utility; For the sample size, For the first One sample data; For the first m A probability function with each variable as an independent variable; Indicates that the independent variable is the first... One variable; Therefore, the first A probability function of nth sample where each variable is an independent variable; These are tiny differences or increments used for numerical simulation of partial derivatives;
[0192] In binary categorical variables, the average marginal effect is the change in the predicted probability of travel delay as the binary variable changes from 0 to 1, and the calculation formula is shown below:
[0193]
[0194] In the formula, For the first n The data sample number m One factor variable The probability of the severity j of the traffic delay caused by the time; For the first n The data sample number m One factor variable The severity of traffic delays caused by time j The probability of.
[0195] The Logit model based on stochastic parameters (RPLHM) combines with transferability theory to conduct global and local transferability analysis of artificially divided groups, namely, whether the influence mechanisms of two groups are similar, and whether the model of a single group can maintain good performance on the data of another group; the overall dataset is divided into day / night and weekday / restday, and the consistency or difference of the influencing factors of driving delay between groups is detected.
[0196] The specific analysis steps are as follows:
[0197] (31) Divide all sample data into two groups: daytime / nighttime and weekday / weekend;
[0198] (32) Calculate the first log-likelihood ratio test, with a critical confidence level of 95.00%, to test whether there is transferability of influencing factors between the overall traffic delay data and the subgroups; the subgroups include daytime, nighttime, weekdays and weekends.
[0199] The test statistic follows a chi-square distribution, and the formula for the log-likelihood ratio test is shown below:
[0200]
[0201] In the formula, The chi-square value, This represents the log-likelihood ratio at which the model converges when modeling based on delay data caused by traffic accidents from the overall sample. and Subgroups and subgroups The log-likelihood ratio at the convergence point of traffic delay data modeling;
[0202] (33) Calculate the second log-likelihood ratio test, with 95.00% as the critical confidence level, to compare the local transferability of influencing factors between day and night, and between weekdays and weekends, and to analyze the stability of parameter estimation;
[0203] The test statistic for this group follows a chi-square distribution, and the calculation formula is shown below:
[0204]
[0205] In the formula, The chi-square value, Indicates the user group Traffic delay severity model for groups The log-likelihood function value obtained when modeling traffic data converges; For the user group The log-likelihood function value at convergence of traffic delay data modeling;
[0206] (34) Compare the influencing factors, parameter estimation coefficients, signs, and average marginal effects of different groups. Assume that variables with a current significance probability lower than the significance level of 0.01 are significant variables, and divide them into the following three cases: ① Significant in one group and not significant in another; ② The same variable is significant in both weekday and weekend or daytime and nighttime groups, but the effects of parameter estimation coefficient signs and average marginal effects are opposite; ③ The same variable is significant in both groups, and the effects of parameter estimation coefficient signs and average marginal effects are the same. Conduct a difference study on the weekday / weekend and daytime / nighttime groups.
[0207] A two-layer model combining latent categories and machine learning is used to identify heterogeneous groups in the degree of driving delays at urban traffic accident sites, clarifying the optimal scenario for heterogeneous group segmentation; delay degree prediction, selecting the best machine learning model to predict the delay degree of heterogeneous groups; and group heterogeneity analysis, combining the SHAP model to interpret and analyze the global importance of different features in heterogeneous groups.
[0208] The specific analysis steps are as follows:
[0209] (41) Establish a latent category model to identify heterogeneous groups, calculate three types of fitting indices (AIC, BIC, SSA-BIC) and three types of significance indices (entropy, LMRT, BLRT) to determine the optimal number of clusters and classify heterogeneous groups;
[0210] Assuming the latent class Logit model has Potential categories, in Under the category, the severity of travel delays is as follows: The conditional probability of the nth event occurring is as follows:
[0211]
[0212] In the formula, This represents the error term, which is a constant. Indicating accident samples In China, the severity of traffic delays The set of influencing factors; for Traffic delay severity by category The vector of independent variable parameters; Indicates in Traffic delay level under category The The incident, The transpose operator for the parameter vector;
[0213] No. The sample of driving delays after a traffic accident belongs to k The probability calculation for each category is as follows:
[0214]
[0215] In the formula, Belongs to k The set of influencing factors in the category; These are the corresponding influencing factor variables;
[0216] Combining the above formula, the severity of traffic delays caused by traffic accidents is: The formula for calculating the total probability of the nth accident is as follows:
[0217]
[0218] Based on the above formula, the maximum likelihood method is used to estimate the parameters of the latent class Logit model, and finally the cluster probability corresponding to each driving delay sample is obtained, and the cluster category is automatically divided.
[0219] The latent category model metrics are as follows:
[0220] 1) The Akaike Information Criterion (AIC) is a weighted function of the log-likelihood function value and the number of parameters. The calculation formula is shown below:
[0221]
[0222] In the formula, E The AIC index represents the number of free parameters for model convergence. The smaller the value of the AIC index, the better the model fits.
[0223] 2) Bayesian Information Criterion (BIC)
[0224] Consider the number of samples to prevent excessive complexity and overfitting caused by excessively high model accuracy.
[0225] The calculation formula is as follows:
[0226]
[0227] 3) Sample correction The calculation formula is as follows:
[0228]
[0229] In the formula, The number of model parameter estimates; This is the log-likelihood value at which the latent class model converges; The sample size is the total number of sample data points for traffic delay data. This represents the sample size for the corrected traffic delay data; The smaller the value, the better the model fits the data.
[0230] 4) Entropy ( )
[0231] Entropy is often used to measure the optimal number of clusters, and the calculation formula is shown below:
[0232]
[0233] In the formula, This indicates the number of clusters selected, where N is the total number of samples of traffic delays caused by traffic accidents. For the first Traffic delay data caused by traffic accidents belongs to the cluster. q The posterior probability value; the entropy value is between 0 and 1, and the larger the value, the more accurate the cluster number;
[0234] 5) Likelihood ratio test ( ) and Bootstrap-based likelihood ratio test ( )
[0235] and Used for comparison One and The fit difference between the models of each category; when the significance probabilities of two parameters are significant, then the current The latent class model for each category has a better fit than... The model performance of each category; conversely, a preference is given to choosing... The classification results of the latent class model for each category;
[0236] (42) Use the SmoteEnn algorithm to balance the data, and sort the feature importance output by the XGboost algorithm in descending order; for the sorted features, gradually reduce the number of features at 10% intervals and train the model, determine the optimal feature ratio for different heterogeneous groups based on the accuracy of the XGboost model, and screen redundant feature variables.
[0237] (43) Based on the feature quantity screening, the degree of driving delay at the location of urban traffic accidents is used as the dependent variable. Four models, namely Random Forest, XGBoost, LightGBM and CatBoost, are used to model and predict the heterogeneous population. The hyperparameters of the above models are adjusted by using a Bayesian model based on tree structure probability density and cross-validation.
[0238] The Bayesian hyperparameter optimization (TPE-BO) conditioning model based on tree structure probability density includes Bayesian optimization (BO) and tree structure probability density estimation (TPE).
[0239] Bayesian optimization finds the optimal parameter combination by finding the maximum or minimum value of the objective function, as shown in the formula:
[0240]
[0241] In the formula, To obtain the optimal hyperparameters, For parameter space, The objective function is...
[0242] Bayesian optimization is achieved using a probability distribution model and a data acquisition function. The solution is also distinguished by the differences between these two parts among different Bayesian optimization models. The former is a model built using existing historical parameter tuning data; the latter provides a reference for the selection of hyperparameter combinations, continuously introducing new combinations into the probability distribution model and iterating to the maximum number of times.
[0243] In the Bayesian optimization model, the acquisition function considers both exploring unknown regions and existing regions, and takes the form of maximizing expected improvement (EI), as shown in the following equation:
[0244]
[0245] In the formula, , which is the optimal value of the observation threshold; For the input variables, The predicted input value for the objective function; This represents the expected improvement, specifically the anticipated improvement in value y at point x. It is the data acquisition function;
[0246] Tree structure probability density estimation (TPE), as a probabilistic surrogate model, differs primarily in its acquisition function. The solution; according to Bayes' theorem, the conditional probability can be calculated using the formula:
[0247]
[0248] In the formula, For input variables, The objective function value, Input variables The prior probability, For target value marginal distribution Input variables The posterior probability;
[0249] TPE probabilistic proxy model takes into account High computational cost, through and Solution:
[0250]
[0251]
[0252] In the formula, For observations The expected loss function is greater than Density estimation;
[0253] For the density estimate of the remaining observations; Selected in the TPE algorithm As part of the observations quantile values;
[0254] From the above equation, the final maximum expected improvement EI can be obtained as:
[0255]
[0256] As can be seen from the above equation, the TPE-BO model does not require... Modeling, and the optimization process only applies to The optimal combination of hyperparameters is obtained through evaluation.
[0257] (44) Finally, the model performance was evaluated using the accuracy and F1 score metrics, and models suitable for each heterogeneous population were selected. The metrics included accuracy, precision, and recall.
[0258] (45) Combine the SHAP method to calculate the absolute SHAP value of different features, and analyze their global importance to features in different groups and their influence on single and interactive features in different heterogeneous groups.
[0259] SHAP is a game theory-based framework for explaining the input-output mechanism of machine learning models, and it can be combined with different machine learning models for interpretation. SHAP calculates the feature-assigned shap value for the prediction results of a single sample, and can further use the sum of the shap values of each feature to interpret the model's predictions.
[0260] Specifically:
[0261] First, the Shapley value needs to be calculated. Considering the non-independence between features, SHAP calculates a weighted average of possible feature combinations to obtain the feature value. The final attribution value is calculated using the formula shown below:
[0262]
[0263] In the formula, For the set of all features, For set A subset that does not contain features Features are extracted by training two models. SHAP value, Indicates the use of inclusion features The model trained on a subset of the dataset. Representing a feature subset The trained model, and , where is the expected value of the function of the input features;
[0264] Secondly, based on the excellent properties of SHAP in terms of local accuracy, missing data, and consistency, the predicted values of the machine learning model with the highest prediction accuracy are obtained. The calculation formula explained is:
[0265]
[0266] In the formula, To explain the model, The state indicating whether a feature has been observed. express The dimension of the feature space, i.e., the size of the feature space, is such that if a feature is not observed, then... M represents the total number of features. Predict the mean for all samples. Features The attribution value.
[0267] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application.
[0268] It should be noted that any technical features not described in detail in this invention can be implemented using any existing technology.
Claims
1. A method for analyzing the multi-dimensional characteristics of travel delay at urban traffic accident locations, comprising: The preprocessing module is used to preprocess the dataset of traffic delay levels at urban accident locations; Based on the Logit model with random parameters that considers mean heterogeneity, this study analyzes the individual heterogeneity of driving delays at urban traffic accident sites. Combined with the average marginal effect value, it analyzes the variables that have a significant impact on driving delays and the partial sample characteristics of their impact differences from four dimensions: road, weather, point of interest, and time. Based on the Logit model with random parameters, this study combines it with the transferability theory to conduct global and local transferability analysis of artificially divided groups. It analyzes whether the influence mechanisms of the two groups are similar and whether the model of a single group can maintain good performance on the data of another group. The overall dataset is divided into day / night and weekday / rest day, and the consistency or difference of the influencing factors of driving delay between groups is detected. A two-layer model combining latent categories and machine learning is used to identify heterogeneous groups in the degree of driving delays at urban traffic accident sites, clarifying the optimal scenario for heterogeneous group segmentation; delay degree prediction, selecting the best machine learning model to predict the delay degree of heterogeneous groups; and group heterogeneity analysis, combining the SHAP model to interpret and analyze the global importance of different features in heterogeneous groups.
2. The method for analyzing the multi-dimensional characteristics of driving delay at urban traffic accident locations according to claim 1, characterized in that, The specific analysis steps of the preprocessing model are as follows: (11) Based on the duration of the delay, the dependent variable of the degree of driving delay is divided into minor delay, severe delay and extreme delay. Factors that have no explanatory significance and belong to the lag variables of the accident are initially excluded, including the accident end time and the start and end latitude and longitude variables. (12) Based on the accident description field, extract four categories of derived variables: road condition, road type, peak time and season at the time of the accident, combined with the location of the urban road; (13) Based on the characteristics of statistical distribution, delete the characteristics of wind chill temperature and rainfall variables that have excessively high missing data rates and are similar in meaning to other variables; Calculate the variance of all variables and delete variables with a variance of 0, i.e., variables with a single distribution and no distinguishing power, including speed bumps, yield signs, roundabouts, turning loops, and traffic lights; fill in the variables of weather conditions, wind direction, air pressure, visibility, relative humidity, humidity, and wind speed. (14) Discretize and bin the variables of temperature, visibility and wind speed, and convert all subcategories of weather conditions, wind direction, peak period, season, temperature, visibility and wind speed into independent binary classification features, and use 0 and 1 to represent binary state variables. (15) Based on the tolerance and variance inflation factor indices of the regression model, collinearity diagnosis is performed on all variables in the road dimension, point of interest dimension, weather dimension and time dimension.
3. The method for analyzing the multi-dimensional characteristics of driving delay at urban traffic accident locations according to claim 2, characterized in that, In step (13), the method for filling in the weather conditions, wind direction, air pressure, visibility, relative humidity, humidity, and wind speed is as follows: For weather conditions and wind direction variables, missing values were filled using cold platform data and the mode. For variables such as air pressure, visibility, temperature, relative humidity, and wind speed, regression predictions were performed using the Missforest multiple imputation method based on a random forest model. The specific steps for imputation are as follows: First, combine the P variables to be filled, each with a data quantity of n, into of For dimensional data, use the mode or mean to initially fill in the gaps; Secondly, sort the variables with missing values according to their missing values and select the variable with the smallest missing value. As the primary filler variable; Furthermore, using variables As predictor variables, the remaining variables are used as feature variables, and are categorized according to whether they contain missing values. Observations , missing values , Other observations and Other observations besides the missing values ; Finally, and Input it into the random forest model for training, and utilize Predicting missing data from data ; During multiple iterations of the random forest model, when the latest filling result differs from the previous filling result... X’ s Calculation stops when the value approaches 0, indicating that missing values have been filled. ; In the formula, and They represent The latest and last completed datasets for the variable.
4. The method for analyzing the multi-dimensional characteristics of driving delay at urban traffic accident locations according to claim 2, characterized in that, In step (14), all subcategories of weather conditions, wind direction, peak hours, season, temperature, visibility, and wind speed are converted into independent binary classification features. The method is as follows: A multi-category variable is divided into total When a single subcategorical variable is defined, a certain subclass... It is set as a reference variable and will not be included in the scope of modeling variables. Then, the state of the binary variable is represented by 0 and 1. When the value of the variable is 1, it means that the state of the variable exists. Furthermore, in multi-category variables, if a certain subclass... When used as a reference variable, if the value of other subclasses is 0, The indicated state is valid.
5. The method for analyzing the multi-dimensional characteristics of driving delay at urban traffic accident locations according to claim 2, characterized in that, In step (15), the evaluation indicators for collinearity diagnosis are tolerance and variance inflation factor; Tolerance is calculated as follows: ; In the formula, To make the first One variable representing the degree of delay was taken as the dependent variable, and the remaining... k -1 variables are used as independent variables to establish the determination coefficient of a linear regression model; the tolerance value ranges from 0 to 1, and the closer it is to 1, the lower the degree of collinearity among the independent variables; The formula for calculating the variance inflation factor is as follows: ; In the formula, VIF The variable is the reciprocal of tolerance. of and Showing a positive correlation, The larger the value, the stronger the correlation between this variable and other variables; The criteria for determining collinearity are: ① ; ② ; When criterion ① is met, it indicates that there is multicollinearity among the variables; when both criterion ① and criterion ② are met, it indicates that the data has severe multicollinearity.
6. The method for analyzing the multi-dimensional characteristics of travel delay at urban traffic accident locations according to claim 1, characterized in that, The specific analysis steps based on the Logit model with stochastic parameters that considers mean heterogeneity are as follows: (21) The Monte Carlo method was adopted, and slight delay was selected as the reference delay level for establishing the random parameter Logit model. First, a multinomial logit model was adopted, and 0.01 was selected as the critical significance level of the parameter. The stepwise backward method was used to eliminate insignificant variables one by one to complete the model calibration. Specifically, the MNL model from the traditional Logit model is selected, which assumes that the random terms are independent and follow an extreme value type I distribution, with the utility function being: ; In the formula, Indicates the first n A vector of factors influencing delay data in each sample; To estimate the parameter vector; This is the error term; From the above equation, the density function formula for the MNL model is: ; Because the traditional Logit model does not consider the effects of various factors on different levels of travel delay, it suffers from heterogeneity across different data samples. Add random items At this point, the estimated parameter vector is expressed as: ; In the formula, For fixed parameters, This represents the coefficient matrix, i.e., the covariance of random parameters and latent correlations. Represents a random term with zero mean and covariance matrix equal to the identity matrix; estimates the parameter vector. It is represented as a linear combination of fixed parameters and random terms; The multinomial Logit model further evolved into the stochastic parameter Logit model; (22) Select the RPL model in the Logit model, substitute the significant variables into the RPL model to identify and estimate the random parameters; select the Halton sampling method for the sampling method of the sample, assume that all variables are random parameters, and perform parameter distribution calibration in the form of normal distribution and binomial; retain the random parameter variables with significance, and set the parameters with significance higher than the threshold as fixed parameters; (23) Given the significant parameters of the RPL model, calibrate the random parameter Logit model; maintain the random parameter state of the heterogeneous variables, assume that all fixed parameters are heterogeneous variables with mean, and calibrate the parameters in turn; variables that pass the significance test are calibrated as explanatory variables of random parameters, and those that do not pass the significance test remain as fixed parameters; (24) Combine the average marginal effect index to quantitatively analyze the impact of four dimensions of factors—road, weather, point of interest, and time—on the probability of minor, severe, and extreme driving delays; In continuous variables, the average marginal effect is the partial derivative of the probability function with respect to the independent variable, and its marginal benefit is calculated as follows: ; In the formula, For the first Factors affecting the severity of delays The average marginal utility; For the sample size, For the first One sample data; For the first m A probability function with each variable as an independent variable; Indicates that the independent variable is the first... One variable; Therefore, the first A probability function of nth sample where each variable is an independent variable; These are tiny differences or increments used for numerical simulation of partial derivatives; In binary categorical variables, the average marginal effect is the change in the predicted probability of travel delay as the binary variable changes from 0 to 1, and the calculation formula is shown below: ; In the formula, For the first n The data sample number m One factor variable The probability of the severity j of the traffic delay caused by the time; For the first n The data sample number m One factor variable The severity of traffic delays caused by time j The probability of.
7. The method for analyzing the multi-dimensional characteristics of travel delay at urban traffic accident locations according to claim 1, characterized in that, The specific analytical steps based on the Logit model with random parameters and the theory of transferability are as follows: (31) Divide all sample data into two groups: daytime / nighttime and weekday / weekend; (32) Calculate the first log-likelihood ratio test, with 95.00% as the critical confidence level, to test whether there is transferability of influencing factors between the overall traffic delay data and the subgroups; the subgroups include daytime, nighttime, weekdays and weekends; The test statistic follows a chi-square distribution, and the formula for the log-likelihood ratio test is shown below: ; In the formula, The chi-square value, This represents the log-likelihood ratio at which the model converges when modeling based on delay data caused by traffic accidents from the overall sample. and Subgroups and subgroups The log-likelihood ratio at the convergence point of traffic delay data modeling; (33) Calculate the second log-likelihood ratio test, with 95.00% as the critical confidence level, to compare the local transferability of influencing factors between day and night, and between weekdays and weekends, and to analyze the stability of parameter estimation. The test statistic for this group follows a chi-square distribution, and the calculation formula is shown below: ; In the formula, The chi-square value, LL(β ci,cj ) Indicates the user group Traffic delay severity model for groups The log-likelihood function value obtained when modeling traffic data converges; For the user group The log-likelihood function value at convergence of traffic delay data modeling; (34) Compare the influencing factors, parameter estimation coefficients, signs, and average marginal effects of different groups. Assume that variables with a current significance probability lower than the significance level of 0.01 are significant variables, and divide them into the following three cases: ① Significant in one group and not significant in another; ② The same variable is significant in both weekday and weekend or daytime and nighttime groups, but the effects of parameter estimation coefficient signs and average marginal effects are opposite; ③ The same variable is significant in both groups, and the effects of parameter estimation coefficient signs and average marginal effects are the same. Conduct a difference study on the weekday / weekend and daytime / nighttime groups.
8. The method for analyzing the multi-dimensional characteristics of travel delay at urban traffic accident locations according to claim 1, characterized in that, The specific analysis steps of the latent category and machine learning two-layer model are as follows: (41) Establish a latent category model to identify heterogeneous groups, calculate three types of fitting indices (AIC, BIC, SSA-BIC) and three types of significance indices (entropy, LMRT, BLRT) to determine the optimal number of clusters and classify heterogeneous groups; Assuming the latent class Logit model has Potential categories, in Under the category, the severity of travel delays is as follows: The conditional probability of the nth event occurring is as follows: ; In the formula, This represents the error term, which is a constant. Indicating accident samples In China, the severity of traffic delays The set of influencing factors; for Traffic delay severity by category The vector of independent variable parameters; Indicates in Traffic delay level under category The The incident, The transpose operator for the parameter vector; No. The sample of driving delays after a traffic accident belongs to k The probability calculation for each category is as follows: ; In the formula, Belongs to k The set of influencing factors in the category; These are the corresponding influencing factor variables; Combining the above formula, the severity of traffic delays caused by traffic accidents is: The formula for calculating the total probability of the nth accident is as follows: ; Based on the above formula, the maximum likelihood method is used to estimate the parameters of the latent class Logit model, and finally the cluster probability corresponding to each driving delay sample is obtained, and the cluster category is automatically divided. (42) Use the SmoteEnn algorithm to balance the data, and sort the feature importance output by the XGboost algorithm in descending order; for the sorted features, gradually reduce the number of features at 10% intervals and train the model, determine the optimal feature ratio for different heterogeneous groups based on the accuracy of the XGboost model, and screen redundant feature variables. (43) Based on the feature quantity screening, the degree of driving delay at the location of urban traffic accidents is used as the dependent variable. Four models, namely Random Forest, XGBoost, LightGBM and CatBoost, are used to model and predict the heterogeneous population. The hyperparameters of the above models are adjusted by using a Bayesian model based on tree structure probability density and cross-validation. (44) Finally, the model performance was evaluated using the accuracy and F1 score metrics, and models suitable for each heterogeneous population were selected. The metrics included accuracy, precision, and recall. (45) Combine the SHAP method to calculate the absolute SHAP value of different features, and analyze their global importance to features in different groups and their influence on single and interactive features in different heterogeneous groups. Specifically: First, the Shapley value needs to be calculated. Considering the non-independence between features, SHAP calculates a weighted average of possible feature combinations to obtain the feature value. The final attribution value is calculated using the formula shown below: ; In the formula, For the set of all features, For set A subset that does not contain features ; By training two models, features are extracted. SHAP value, Indicates the use of inclusion features The model trained on a subset of the dataset. Representing a feature subset The trained model, and , where is the expected value of the function of the input features; Secondly, based on the excellent properties of SHAP in terms of local accuracy, missing data, and consistency, the predicted values of the machine learning model with the highest prediction accuracy are obtained. The calculation formula explained is: ; In the formula, To explain the model, The state indicating whether a feature has been observed. express The dimension of the feature space, i.e., the size of the feature space, is such that if a feature is not observed, then... M represents the total number of features. Predict the mean for all samples. Features The attribution value.
9. The method for analyzing the multi-dimensional characteristics of driving delay at urban traffic accident locations according to claim 8, characterized in that, In step (41), the latent class model metrics are as follows: 1) The Akaike Information Criterion value is a weighted function of the log-likelihood function value and the number of parameters, and the calculation formula is shown below: ; In the formula, E The AIC index represents the number of free parameters for model convergence. The smaller the value of the AIC index, the better the model fits. 2) Bayesian Information Criterion Value Consider the number of samples to prevent excessive complexity and overfitting caused by excessively high model accuracy. The calculation formula is as follows: ; 3) Sample correction The calculation formula is as follows: ; In the formula, The number of model parameter estimates; This is the log-likelihood value at which the latent class model converges; The sample size represents the total number of sample data points for traffic delay data. This represents the sample size for the corrected traffic delay data; The smaller the value, the better the model fits the data. 4) Entropy To determine the optimal number of clusters, entropy is used as a metric, and the calculation formula is shown below: ; In the formula, This indicates the number of clusters selected, where N is the total number of samples of traffic delays caused by traffic accidents. For the first Traffic delay data caused by traffic accidents belongs to the cluster. q The posterior probability value; the entropy value is between 0 and 1, and the larger the value, the more accurate the cluster number; 5) Likelihood ratio test and Bootstrap-based likelihood ratio test and Used for comparison One and The fit difference between the models of each category; when the significance probabilities of two parameters are significant, then the current The latent class model for each category has a better fit than... The model performance of each category; conversely, a preference is given to choosing... The classification results of the latent class model for each category.
10. A method for analyzing the multi-dimensional characteristics of travel delay at urban traffic accident locations according to claim 8, characterized in that, In step (43), the Bayesian hyperparameter optimization adjustment model based on tree structure probability density includes Bayesian optimization and tree structure probability density estimation; Bayesian optimization finds the optimal parameter combination by finding the maximum or minimum value of the objective function, as shown in the formula: ; In the formula, To obtain the optimal hyperparameters, For parameter space, The objective function is... Bayesian optimization is achieved using a probability distribution model and a data acquisition function. The solution is also distinguished by the differences between these two parts among different Bayesian optimization models. The former is a model built using existing historical parameter tuning data; the latter provides a reference for the selection of hyperparameter combinations, continuously introducing new combinations into the probability distribution model and iterating to the maximum number of times. In the Bayesian optimization model, the acquisition function considers both exploring unknown regions and existing regions, and takes the form of maximizing the expected improvement, as shown in the following equation: ; In the formula, , which is the optimal value of the observation threshold; For the input variables, The predicted input value for the objective function; This represents the expected improvement, specifically the anticipated improvement in value y at point x. It is the data acquisition function; Tree structure probability density estimation (TPE) as a probabilistic surrogate model differs primarily in its acquisition function. The solution; according to Bayes' theorem, the conditional probability can be calculated using the formula: ; In the formula, For input variables, The objective function value, Input variables The prior probability, For target value marginal distribution Input variables The posterior probability; TPE probabilistic proxy model takes into account High computational cost, through and Solution: ; ; In the formula, For observations The expected loss function is greater than Density estimation; For the density estimate of the remaining observations; Selected in the TPE algorithm As part of the observations quantile values; From the above equation, the final maximization of the expected improvement EI can be obtained as: ; As can be seen from the above equation, the TPE-BO model does not require... Modeling, and the optimization process only applies to An evaluation was conducted to obtain the optimal combination of hyperparameters.