A private car traffic safety risk feature association mining method
By discretizing private car traffic management data based on information entropy theory and constraining frequent item search paths, the problems of slow risk feature identification and low accuracy in existing technologies are solved, and fast and accurate risk feature mining is achieved.
Patent Information
- Application Number
- CN202411797874.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-09
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2044-12-09
AI Technical Summary
Existing technologies have difficulty in quickly and accurately identifying traffic safety risk characteristics when processing massive, high-dimensional private car traffic management data. They also have problems such as slow association rule algorithm operation, overfitting, generation of many redundant frequent items, and lack of goal orientation.
The information entropy theory is used to discretize numerical variables, and a discretization binning method is used to generate a set of feature variables with high correlation and low redundancy. Frequent items and association rules are generated recursively, and search path constraints are added to reduce redundancy and improve algorithm efficiency.
It achieves the rapid and accurate discovery of traffic safety risk characteristics from massive private car traffic management data, reduces the parameter search space, and improves the algorithm efficiency and accuracy.
Smart Images

Figure CN119691026B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of road traffic safety and data mining, and more particularly, to a private car traffic safety risk feature correlation mining method. BACKGROUND
[0002] In recent years, with the rapid development of economy and the acceleration of urbanization, the number of private cars has increased dramatically, which has brought convenience to public travel, but also increasingly prominent traffic safety problems. Due to the complex interweaving of various factors such as driving habits of private car drivers, vehicle performance, road environment, etc., the private car traffic safety risk features show the characteristics of diversification and complexity. Therefore, in-depth mining of private car traffic safety risk features is of great significance for preventing traffic accidents and improving road safety level.
[0003] Private car traffic safety risk feature mining refers to finding risk features that are prone to cause future traffic accidents from vehicle basic attributes, vehicle owner basic attributes, and massive traffic management data such as private car historical business handling, traffic violations, traffic accidents, etc. At present, there are mainly two types of private car traffic safety risk feature mining methods: one is a single-factor analysis method based on statistics, which analyzes the correlation between candidate features and traffic accident data one by one to verify whether the features have a significant impact on traffic accidents. However, this method is difficult to analyze the combined effect of multiple factors on traffic accidents, resulting in inaccurate and incomplete risk features. The second is a multi-factor analysis method based on data mining, especially the association rule algorithm, which can analyze the combination of features and thus deeply mine the mechanism of multi-factor combination on accidents, finding association rules such as "feature 1 + feature 2 + feature 3 = > traffic accident occurred this year". Therefore, it has gradually become a research hotspot in this field.
[0004] However, using traditional association rule algorithms to mine private car traffic safety risk features faces the following four main problems:
[0005] (1) There are numerical variables such as illegal starting number and illegal score number in private car traffic management data. When the value range of numerical variables is large, the association rule algorithm runs very slowly and has overfitting problems, which requires prior discretization processing;
[0006] (2) The association rule algorithm uses permutation combination traversal to screen frequent items (features or feature combinations with sample size greater than a certain threshold). When there are many candidate features, the algorithm running speed will be significantly reduced;
[0007] (3) When there are multiple values for the same variable in the sample set, the algorithm will also arrange and combine the different values, resulting in a large number of redundant frequent items. For example, if private cars are divided into non-operating, commercial-to-non-operating, taxi passenger transport, and scheduled taxi passenger transport according to their usage, the usage nature of a car will only be one, but the original association rule algorithm will generate a large number of redundant candidate feature combinations such as "non-operating + commercial-to-non-operating", "non-operating + taxi passenger transport", "non-operating + scheduled taxi passenger transport", "commercial-to-non-operating + taxi passenger transport", "commercial-to-non-operating + scheduled taxi passenger transport", "taxi passenger transport + scheduled taxi passenger transport", etc., which will significantly increase the subsequent calculation amount of the model;
[0008] (4) The association rule algorithm lacks a clear goal orientation and will automatically generate a large number of redundant frequent items and association rules, resulting in the mined risk features being irrelevant to whether traffic accidents are likely to occur in the future, and increasing the computational complexity of the model. Redundant frequent items mainly refer to frequent items that do not contain the target variable of whether traffic accidents will occur in the future, such as: "more than 10 violations in the previous year, 2 red light violations in the previous year, more than 5 illegal parking violations in the previous year"; redundant association rules mainly refer to rules whose consequent does not contain the target variable, such as: "more than 10 violations in the previous year + a traffic accident occurred in that year => more than 5 illegal parking violations in the previous year".
[0009] Therefore, when processing massive, high-dimensional private car traffic management data, how to quickly and accurately identify risk characteristics has become a technical problem that needs to be urgently solved in this field. Summary of the Invention
[0010] In order to address the deficiencies in the prior art, the present invention provides a method for mining the association of private car traffic safety risk characteristics, which can quickly and accurately discover private car traffic safety risk characteristics from massive, high-dimensional private car traffic management data, and provide support for the traffic management department's private car hidden danger management and accident prevention work.
[0011] As a first aspect of the present invention, a method for mining association characteristics of private car traffic safety risk is provided, comprising the following steps:
[0012] Step S1: obtaining a set of original traffic management data samples, wherein the set of original traffic management data samples includes original traffic management data samples of multiple private cars, and the original traffic management data sample of each private car includes the private car's own characteristic data, the private car owner's characteristic data, the private car traffic management business processing data, the private car's traffic violation data in the previous year, the private car's traffic accident data in the previous year, and whether the private car had a traffic accident in that year;
[0013] Step S2: the private car itself characteristic data, the private car owner characteristic data, the private car traffic management business handling data, the private car traffic violation data of the previous year and the private car traffic accident data of the previous year are all taken as characteristic variables, and whether the private car has traffic accident this year is taken as a target variable;
[0014] Step S3: all numerical characteristic variables in the original traffic management data sample set are converted into discrete characteristic variables through the discretization binning method;
[0015] Step S4: all candidate characteristic variables with a degree of importance higher than a first threshold value are screened out from the original traffic management data sample set, and a new traffic management data sample set is constructed with all candidate characteristic variables and the target variable in the original traffic management data sample set;
[0016] Step S5: each candidate characteristic variable in the new traffic management data sample set is respectively coded in categories, serial numbers and one-hot, and the target variable in the new traffic management data sample set is respectively coded in categories and dummy variables;
[0017] Step S6: the candidate characteristic variables and the target variable in the new traffic management data sample set are combined in a recursive manner to generate a candidate item set, and all frequent items with a support degree greater than a second threshold value are screened out from the candidate item set to generate a frequent item set;
[0018] Step S7: a candidate association rule set is constructed according to the frequent item set, and all final association rules with a confidence degree greater than a third threshold value are screened out from the candidate association rule set to generate a final association rule set, wherein the feature vector in the final association rule set is a characteristic variable with traffic safety risk.
[0019] Further, the private car itself characteristic data includes vehicle type, vehicle use nature and vehicle fuel type, the private car owner characteristic data includes owner gender, owner age and owner driving age, the private car traffic management business handling data includes vehicle transfer number, vehicle illegal handling person number and accident party number, the private car traffic violation data of the previous year includes vehicle total illegal number, vehicle illegal score number and vehicle illegal behavior handling number, and the private car traffic accident data of the previous year includes vehicle simple procedure accident number, vehicle general procedure injury accident number and vehicle general procedure death accident number.
[0020] The vehicle type, vehicle use property, vehicle fuel type, and owner gender are discrete characteristic variables, and the owner age, owner driving age, vehicle transfer number, vehicle illegal handling person number, accident party number, vehicle illegal total number, vehicle illegal score number, vehicle illegal behavior handling number, vehicle simple procedure accident number, vehicle general procedure injury accident number, and vehicle general procedure death accident number are numerical characteristic variables.
[0021] Further, the conversion of all numerical characteristic variables in the original traffic management data sample set into discrete characteristic variables by the discretization and binning method further comprises:
[0022] Step S31: For each numerical characteristic variable in the original traffic management data sample set, an equal-frequency binning method is used to generate a plurality of initial division points of the numerical characteristic variable, and the information entropy of the target variable in each initial division point divided two subsets is calculated. The information gain corresponding to each initial division point is calculated according to the information entropy of the target variable in each initial division point divided two subsets. The initial division point with the maximum information gain is selected as the optimal division point of the numerical characteristic variable, and the numerical characteristic variable is divided into two subsets according to the optimal division point.
[0023] The calculation formula of the information entropy H(S v ) of the target variable y in each subset after each initial division point is as follows:
[0024] H(S v ) = -p v log2(p v )-(1-p v )log2(1-p v )
[0025] Wherein, S v is a subset divided according to the initial division point; p v is the proportion of the number of private cars involved in traffic accidents in the subset S v in the total number of private cars in the subset S v ;
[0026] The calculation formula of the information gain IG(y, A) of the target variable y corresponding to each initial division point is as follows:
[0027]
[0028] Wherein, A is the initial division point in each numerical characteristic variable, H(y) is the information entropy of the target variable y in the original traffic management data sample set S, and S vis the sub-set divided according to the initial division point A, |S v | represents the number of private cars in the sub-set S v , |S| represents the total number of private cars in the original traffic management data sample set S;
[0029] Step S32: recursively perform the above step S31 on each sub-set divided according to the optimal division point to calculate the optimal division point of each sub-set until the number of bins is greater than the fourth threshold or the increment of information gain is less than the fifth threshold;
[0030] Step S33: convert each numerical feature variable into a discrete feature variable according to the last calculated optimal division point.
[0031] Further, the method further comprises:
[0032] The calculation formula of the importance degree IMP of each feature variable in the original traffic management data sample set is as follows:
[0033] IMP = IG(y, A(x i )) ÷ avg(IG(F, A(x i )))
[0034] Wherein, IG(y, A(x i )) represents the information gain of the target variable y after the original traffic management data sample set S is divided into multiple sub-sets according to a certain feature variable x i , used to measure the correlation degree between the certain feature variable x i and the target variable y.
[0035] Wherein, avg(IG(F, A(x i ))) represents the average information gain of all candidate feature variables in the current candidate feature variable set F after the original traffic management data sample set S is divided into multiple sub-sets according to a certain feature variable x i , used to measure the redundancy degree between the certain feature variable x i and other candidate feature variables in the current candidate feature variable set F.
[0036] Further, the method further comprises:
[0037] The one-hot encoding uses an N-bit state register to encode N states, and in the encoded data, each vehicle has only one candidate feature variable with 1-bit state register in state 1 and other bit state registers are 0;
[0038] The dummy variable encoding uses a 1-bit state register to encode whether the vehicle has a traffic accident this year, and in the encoded data, the target variable of each vehicle is in state 1 if the vehicle has a traffic accident, and in state 0 if the vehicle does not have a traffic accident.
[0039] Further, the combination of the candidate feature variables and the target variable in the new traffic management data sample set in a recursive manner to generate a candidate item set, and the filtering of all frequent items with support greater than a second threshold from the candidate item set to generate a frequent item set further comprises:
[0040] Traversing the corresponding candidate feature variable sequence number of the vehicle having a traffic accident this year to generate a candidate 2-item set of "a certain candidate feature variable + a traffic accident this year", and filtering all candidate 2-items with support greater than the second threshold from the candidate 2-item set as a frequent 2-item set;
[0041] Permutation and combination of the candidate feature variable sequence numbers in the frequent 2-item set to generate a candidate 3-item set of "candidate feature variable 1 + candidate feature variable 2 + a traffic accident this year", and filtering all candidate 3-items with support greater than the second threshold from the candidate 3-item set as a frequent 3-item set;
[0042] Permutation and combination of the candidate feature variable sequence numbers in the frequent 3-item set to generate a candidate 4-item set of "candidate feature variable 1 + candidate feature variable 2 + candidate feature variable 3 + a traffic accident this year", and filtering all candidate 4-items with support greater than the second threshold from the candidate 4-item set as a frequent 4-item set; and repeating the process until no new frequent item set can be generated;
[0043] Wherein, the support Support(x, y (1) ) refers to the number of vehicles in the new traffic management data sample set that simultaneously meet the two conditions of "candidate feature variable" and "traffic accident this year" in the candidate item, and the calculation formula is:
[0044]
[0045] Wherein, x represents the candidate feature variable, y (1) represents the vehicle having a traffic accident this year, and Count(S) represents the total number of vehicles in the new traffic management data sample set.
[0046] Further, the candidate association rule set is constructed according to the frequent item set, and all final association rules with a confidence greater than a third threshold are screened from the candidate association rule set to generate a final association rule set, and the method further comprises:
[0047] The confidence is The confidence is the proportion of vehicles involved in traffic accidents in all vehicles with the candidate feature variable, and the calculation formula is:
[0048]
[0049] The x represents the candidate feature variable, and the y represents the vehicle involved in the traffic accident. (1) The Count (x) represents the total number of vehicles with the candidate feature variable.
[0050] The private car traffic safety risk feature association mining method provided by the application has the following advantages:
[0051] (1) The information entropy theory is used to discretize the numerical variable, and a feature variable set with high correlation with the target variable and low redundancy is generated, so that the parameter search space is reduced and the algorithm efficiency is improved.
[0052] (2) The addition of the frequent item search path constraint avoids generating redundant frequent items and improves the association rule mining speed, so that the private car risk features can be quickly and accurately discovered from the massive private car traffic management data. DETAILED DESCRIPTION
[0053] The accompanying drawings are used to provide a further understanding of the application, and constitute a part of the specification, and are used together with the following specific embodiments to explain the application, but do not constitute a limitation on the application.
[0054] Figure 1 The flow chart of the private car traffic safety risk feature association mining method provided by the application.
[0055] Figure 2 The flow chart of the specific embodiment of the private car traffic safety risk feature association mining method provided by the application. DETAILED DESCRIPTION
[0056] For further illustrating the technical means and effects taken by the present application to achieve the predetermined inventive objectives, the specific implementation, structure, features and effects of the private car traffic safety risk feature correlation mining method according to the present application are described in detail as follows in combination with the drawings and preferred embodiments. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative efforts fall within the protection scope of the present application.
[0057] In the present embodiment, a private car traffic safety risk feature correlation mining method is provided, which comprises the following steps: Figure 1 As shown in the figure, the private car traffic safety risk feature correlation mining method comprises the following steps:
[0058] Step S1: obtaining an original traffic management data sample set, wherein the original traffic management data sample set comprises original traffic management data samples of a plurality of private cars, and the original traffic management data sample of each private car comprises private car self feature data, private car owner feature data, private car traffic management business handling data, private car previous year traffic violation data, private car previous year traffic accident data and private car current year traffic accident occurrence;
[0059] Preferably, the private car self feature data comprises vehicle type, vehicle use nature, vehicle fuel type, vehicle age, vehicle seat number, etc., the private car owner feature data comprises owner gender, owner age, owner driving age, owner qualified vehicle type, the private car traffic management business handling data comprises vehicle transfer number, vehicle illegal handling person number and accident party number, the private car previous year traffic violation data comprises vehicle total illegal number, vehicle illegal score number and vehicle various key illegal behavior handling number (including: drunk driving, overstaffing, overspeeding, fatigue driving, driving without license, red light running, reverse driving, illegal lane changing, illegal overtaking, illegal U-turn, illegal road occupation, etc.), and the private car previous year traffic accident data comprises vehicle simple procedure accident number, vehicle general procedure injury accident number and vehicle general procedure death accident number.
[0060] Among them, the vehicle type, vehicle use nature, vehicle fuel type and owner gender are discrete type feature variables; the owner age, owner driving age, vehicle transfer number, vehicle illegal handling person number, accident party number, vehicle total illegal number, vehicle illegal score number, vehicle various illegal behavior handling number, vehicle simple procedure accident number, vehicle general procedure injury accident number and vehicle general procedure death accident number are numerical value type feature variables.
[0061] Step S2: taking the private car self feature data, the private car owner feature data, the private car traffic management business handling data, the private car previous year traffic violation data and the private car previous year traffic accident data as feature variables, and taking whether the private car has traffic accident this year as a target variable;
[0062] Step S3: converting all numerical feature variables in the original traffic management data sample set into discrete feature variables through a discretization and binning method;
[0063] Preferably, as shown in the step S3, the converting all numerical feature variables in the original traffic management data sample set into discrete feature variables through a discretization and binning method further comprises: Figure 2
[0064] Step S31: for each numerical feature variable in the original traffic management data sample set, using an equal frequency binning method to generate a plurality of initial partition points of the numerical feature variable, and calculating the information entropy of the target variable in each initial partition point divided two sub-sets, according to the information entropy of the target variable in each initial partition point divided two sub-sets, calculating the information gain corresponding to each initial partition point, selecting the initial partition point with the maximum information gain as the optimal partition point of the numerical feature variable, and dividing the numerical feature variable into two sub-sets according to the optimal partition point;
[0065] Wherein, the calculation formula of the information entropy H(S v ) of the target variable y in each sub-set after each initial partition point is divided is as follows:
[0066] H(S v )=-p v log2(p v )-(1-p v )log2(1-p v )
[0067] Wherein, S v is a sub-set divided according to an initial partition point; p v is the proportion of the number of private cars having traffic accident this year in the sub-set S v to the total number of private cars in the sub-set S v ;
[0068] Wherein, the calculation formula of the information gain IG(y,A) of the target variable y corresponding to each initial partition point is as follows:
[0069]
[0070] Among them, A is the initial division point in each numerical feature variable, H(y) is the information entropy of the target variable y in the original traffic management data sample set S, S v is the subset divided according to the initial partition point A, |S v | represents the subset S v The number of private cars in the original traffic management data sample set S, |S| represents the total number of private cars in the original traffic management data sample set S;
[0071] Step S32: recursively perform step S31 for each subset divided by the optimal partition point to calculate the optimal partition point for each subset, until the number of bins is greater than a fourth threshold (e.g., 5 bins) or the increment of information gain is less than a fifth threshold (e.g., 5%);
[0072] Step S33: Convert each numerical feature variable into a discrete feature variable according to the optimal division point calculated last.
[0073] Step S4: Screening out all candidate feature variables whose importance is higher than a first threshold from the original traffic management data sample set, and constructing a new traffic management data sample set with all candidate feature variables and the target variable in the original traffic management data sample set;
[0074] Preferably, if Figure 2 As shown, the method further includes: screening out all candidate feature variables whose importance is higher than a first threshold from the original traffic management data sample set, and constructing a new traffic management data sample set with all candidate feature variables and target variables in the original traffic management data sample set;
[0075] The calculation formula of the importance level IMP of each characteristic variable in the original traffic management data sample set is as follows:
[0076] IMP=IG(y,A(x i ))÷avg(IG(F,A(x i )))
[0077] Among them, IG(y,A(x i )) indicates that according to a certain characteristic variable x i After the original traffic management data sample set S is divided into multiple subsets, the information gain of the target variable y is used to measure the information gain of a certain feature variable x i Correlation with the target variable y;
[0078] Among them, avg(IG(F,A(x i ))) indicates that according to a certain characteristic variable x iAfter the original traffic management data sample set S is divided into multiple subsets, the average information gain of all candidate feature variables in the current candidate feature variable set F is used to measure the importance of a certain feature variable x i the redundancy between the current candidate feature variable set F and other candidate feature variables.
[0079] For example, if the importance of a certain feature variable in the original traffic management data sample set exceeds 0.03, it is added to the candidate feature variable set F, and finally the target variable is placed in the set F to generate a new traffic management data sample set.
[0080] Step S5: respectively performing category encoding, serial number encoding and one-hot encoding on each candidate feature variable in the new traffic management data sample set, and respectively performing category encoding and dummy variable encoding on the target variable in the new traffic management data sample set;
[0081] It should be noted that category encoding is used to distinguish candidate feature variables and target variables, and one-hot encoding of candidate feature variables and dummy variable encoding of target variables are used to mark variable values.
[0082] Preferably, the category encoding, serial number encoding and one-hot encoding of each candidate feature variable in the new traffic management data sample set, and the category encoding and dummy variable encoding of the target variable in the new traffic management data sample set further comprise:
[0083] The one-hot encoding uses an N-bit state register to encode N states, and in the encoded data, only one candidate feature variable of each vehicle has a state register in state 1, and the other state registers are all 0;
[0084] The dummy variable encoding uses a 1-bit state register to encode whether a vehicle has a traffic accident in the current year, and in the encoded data, the target variable of each vehicle is in state 1 if it is a traffic accident vehicle, and in state 0 if it is not a traffic accident vehicle.
[0085] Step S6: combining the candidate feature variables and the target variable in the new traffic management data sample set in a recursive manner to generate a candidate item set, and screening all frequent items with a support greater than a second threshold from the candidate item set to generate a frequent item set;
[0086] Preferably, as shown in the step S6, the way to generate the frequent item set is: Figure 2
[0087] First, initialize the total frequent item set L = {}, then let k = 2, combine the item with the target variable dummy variable encoding value 1 with each candidate feature variable one-hot encoding value 1 in turn, and screen the combination item with support greater than 5% as the frequent k-item set l k ;
[0088] If the frequent k-item set l k is empty, the algorithm ends and no risk feature variable is found; if the frequent k-item set l k is not empty, add the frequent k-item set l k to the total set L, and loop the following steps until no new frequent item set can be generated: self-connect the candidate feature variables in each frequent k-item in the frequent k-item set l k , generate candidate k+1 items containing target variables, and screen the combination item with support greater than 5% as the frequent k+1 item set l k+1 , and then let k = k + 1.
[0089] Specifically, the step S6 further includes:
[0090] Traverse the corresponding candidate feature variable sequence number of the vehicle that has traffic accidents in the current year to generate a candidate 2-item set of "a certain candidate feature variable + traffic accidents in the current year", and screen all candidate 2-items with support greater than the second threshold value from the candidate 2-item set as the frequent 2-item set;
[0091] Arrange and combine the candidate feature variable sequence numbers in the frequent 2-item set to generate a candidate 3-item set of "candidate feature variable 1 + candidate feature variable 2 + traffic accidents in the current year", and screen all candidate 3-items with support greater than the second threshold value from the candidate 3-item set as the frequent 3-item set;
[0092] Arrange and combine the candidate feature variable sequence numbers in the frequent 3-item set to generate a candidate 4-item set of "candidate feature variable 1 + candidate feature variable 2 + candidate feature variable 3 + traffic accidents in the current year", and screen all candidate 4-items with support greater than the second threshold value from the candidate 4-item set as the frequent 4-item set; and repeat the process until no new frequent item set can be generated;
[0093] Wherein, the support Support(x, y (1) ) refers to the number of vehicles in the new traffic management data sample set that simultaneously meet the two conditions of "candidate feature variable" and "traffic accidents in the current year" in the candidate item, and the calculation formula is:
[0094]
[0095] Wherein, x represents the candidate feature variable, y(1) Count (S) represents the total number of vehicles in the new traffic management data sample set.
[0096] Step S7: constructing a candidate association rule set according to the frequent item set, and screening all final association rules with a confidence greater than a third threshold from the candidate association rule set to generate a final association rule set, wherein the feature vector in the final association rule set is a feature variable with a traffic safety risk.
[0097] Preferably, the constructing a candidate association rule set according to the frequent item set, and screening all final association rules with a confidence greater than a third threshold from the candidate association rule set to generate a final association rule set further comprises:
[0098] For each frequent item in the frequent item set, a candidate association rule with a candidate feature variable as the former item and a target variable as the latter item is constructed to generate a candidate association rule set, all final association rules with a confidence greater than a third threshold are screened to generate a final association rule set, and the former item in the final association rule is the feature variable with a traffic safety risk.
[0099] The confidence is is a standard for measuring the reliability of the candidate association rule, which represents the proportion of vehicles with traffic accidents in the year among all vehicles with one condition of the candidate feature variable in the candidate item, and the calculation formula is:
[0100]
[0101] wherein x represents the candidate feature variable, y (1) Count (S) represents the total number of vehicles in the new traffic management data sample set.
[0102] The private car traffic safety risk feature association mining method provided by the application applies information entropy theory to discretize numerical variables, finds a feature variable set with higher correlation with a target variable and lower redundancy, and improves the association rule algorithm by adding a search path constraint, thereby quickly and accurately discovering private car risk features from massive and high-dimensional private car traffic management data, and providing support for private car hidden danger management and accident prevention work of the traffic management department.
[0103] The private car traffic safety risk feature association mining method provided by the application has the advantages that (1) in view of the performance decline of the association rule algorithm in processing continuous variables and high-dimensional sample data, the application performs discretization processing on the numerical variables based on the information entropy theory, generates a feature variable set with higher correlation and lower redundancy with the target variable, and achieves the effects of reducing the parameter search space and improving the algorithm efficiency; and (2) in view of the low efficiency of the traversal search of frequent items in the association rule algorithm, the application can avoid generating redundant frequent items and improve the association rule mining speed by adding the frequent item search path constraint, and the purpose of quickly and accurately discovering the private car risk features from massive private car traffic management data is achieved.
[0104] The above is only a preferred embodiment of the application, and does not limit the application in any form. Although the application has been disclosed as above with the preferred embodiment, it is not intended to limit the application. Any person skilled in the art can make some changes or modifications to the above disclosed technical content without departing from the technical solution of the application, and the equivalent embodiments with equivalent changes are equivalent to the above embodiments. Any simple modification, equivalent change and modification of the above embodiments according to the technical essence of the application are still within the scope of the technical solution of the application.
Claims
1. A method for mining association characteristics of private car traffic safety risk, characterized by: The following steps are involved: Step S1: obtaining a set of original traffic management data samples, wherein the set of original traffic management data samples includes original traffic management data samples of multiple private cars, and the original traffic management data sample of each private car includes the private car's own characteristic data, the private car owner's characteristic data, the private car traffic management business processing data, the private car's traffic violation data in the previous year, the private car's traffic accident data in the previous year, and whether the private car had a traffic accident in that year; Step S2: The private car's own characteristic data, the private car owner's characteristic data, the private car traffic management business processing data, the private car's traffic violation data in the previous year, and the private car's traffic accident data in the previous year are all used as characteristic variables, and whether the private car has a traffic accident in that year is used as the target variable; Step S3: converting all numerical feature variables in the original traffic management data sample set into discrete feature variables by using a discretization binning method; Step S4: Screening out all candidate feature variables whose importance is higher than a first threshold from the original traffic management data sample set, and constructing a new traffic management data sample set with all candidate feature variables and the target variable in the original traffic management data sample set; Step S5: performing category coding, sequence coding, and one-hot coding on each candidate feature variable in the new traffic management data sample set, and performing category coding and dummy variable coding on the target variable in the new traffic management data sample set; Step S6: recursively combining the candidate feature variables and the target variable in the new traffic management data sample set to generate a candidate item set, and screening out all frequent items with support greater than a second threshold from the candidate item set to generate a frequent item set; Step S7: constructing a candidate association rule set based on the frequent item set, and screening all final association rules with confidence greater than a third threshold from the candidate association rule set to generate a final association rule set, wherein the feature variables in the final association rule set are feature variables with traffic safety risks; The step of screening out all candidate feature variables with an importance higher than a first threshold from the original traffic management data sample set and constructing a new traffic management data sample set using all candidate feature variables and a target variable in the original traffic management data sample set further includes: The importance of each feature variable in the original traffic management data sample set The calculation formula is as follows: , in, Indicates that according to a certain characteristic variable The original traffic management data sample collection After being divided into multiple subsets, the information gain of the target variable y is used to measure a certain feature variable Correlation with the target variable y; in, Indicates that according to a certain characteristic variable The original traffic management data sample collection After being divided into multiple subsets, the current candidate feature variable set The average information gain of all candidate feature variables in is used to measure the With the current set of candidate feature variables The degree of redundancy among other candidate feature variables in .
2. The method for mining association characteristics of private car traffic safety risk according to claim 1 is characterized in that: The private car's own characteristic data includes vehicle type, vehicle usage nature, and vehicle fuel type; the private car owner's characteristic data includes the owner's gender, age, and driving experience; the private car traffic management business processing data includes the number of vehicle transfers, the number of people handling vehicle violations, and the number of parties involved in accidents; the private car traffic violation data in the previous year includes the total number of vehicle violations, the number of vehicle violation points, and the number of various types of vehicle violations investigated and dealt with; the private car traffic accident data in the previous year includes the number of simple vehicle accidents, the number of general vehicle injury accidents, and the number of general vehicle fatal accidents; Among them, the vehicle type, vehicle usage nature, vehicle fuel type and owner gender are all discrete characteristic variables; the owner age, owner driving experience, number of vehicle transfers, number of people handling vehicle violations, number of parties involved in the accident, total number of vehicle violations, vehicle violation points, number of various types of vehicle violations investigated and dealt with, number of vehicle simple procedure accidents, number of vehicle general procedure injury accidents and number of vehicle general procedure death accidents are all numerical characteristic variables.
3. The method for mining association characteristics of private car traffic safety risk according to claim 1, characterized in that: The step of converting all numerical feature variables in the original traffic management data sample set into discrete feature variables by using a discretization binning method further includes: Step S31: for each numerical characteristic variable in the original traffic management data sample set, use the equal frequency binning method to generate multiple initial division points of the numerical characteristic variable, and calculate the information entropy of the target variable in the two subsets after each initial division point is divided, calculate the information gain corresponding to each initial division point based on the information entropy of the target variable in the two subsets after each initial division point is divided, select the initial division point with the largest information gain as the optimal division point of the numerical characteristic variable, and divide the numerical characteristic variable into two subsets according to the optimal division point; Among them, the information entropy of the target variable y in each subset after each initial partition point is The calculation formula is as follows: , in, It is a subset divided according to the initial partition point; Is a sub-collection The number of private cars involved in traffic accidents in that year accounts for the subset the proportion of private cars in the total number of Among them, the information gain of the target variable y corresponding to each initial partition point is The calculation formula is as follows: , in, is the initial division point in each numerical feature variable, is the original traffic management data sample set The information entropy of the target variable y in , Based on the initial partition point After partitioning, the subset Represents a subcollection The number of private cars in Represents the original traffic management data sample set The total number of private cars in Step S32: recursively executing step S31 for each subset divided by the optimal partition point to calculate the optimal partition point for each subset, until the number of bins is greater than the fourth threshold or the increment of information gain is less than the fifth threshold; Step S33: Convert each numerical feature variable into a discrete feature variable according to the optimal division point calculated last.
4. The method for mining association characteristics of private car traffic safety risk according to claim 1, characterized in that: The step of performing category coding, sequence coding, and one-hot coding on each candidate feature variable in the new traffic management data sample set, and performing category coding and dummy variable coding on the target variable in the new traffic management data sample set, further includes: The one-hot encoding uses an N-bit state register to encode N states. In the encoded data, only one bit of the state register of a single candidate feature variable of each vehicle is in state 1, and the other bits of the state register are all 0; The dummy variable encoding uses a 1-bit status register to encode whether the vehicle has been involved in a traffic accident that year. In the encoded data, the target variable of each vehicle is a traffic accident vehicle, and the status register is in state 1; for non-traffic accident vehicles, the status register is in state 0.
5. The method for mining association characteristics of private car traffic safety risk according to claim 1, characterized in that: The method recursively combines the candidate feature variables and the target variable in the new traffic management data sample set to generate a candidate item set, and filters out all frequent items with support greater than a second threshold from the candidate item set to generate a frequent item set, further comprising: Traverse the candidate feature variable numbers corresponding to the vehicles involved in traffic accidents in that year, generate a candidate two-item set of "a certain candidate feature variable + a traffic accident occurred in that year", and filter out all candidate two items with support greater than the second threshold from the candidate two-item set as the frequent two-item set; Permuting and combining the candidate feature variable numbers in the frequent 2-item set to generate a candidate 3-item set of "candidate feature variable 1 + candidate feature variable 2 + traffic accidents that occurred in that year", and selecting all candidate 3-item sets whose support is greater than a second threshold as the frequent 3-item set from the candidate 3-item set; The candidate feature variable numbers in the frequent 3-item set are permuted and combined to generate a candidate 4-item set of "candidate feature variable 1 + candidate feature variable 2 + candidate feature variable 3 + traffic accidents that occurred in that year", and all candidate 4-item sets with support greater than a second threshold are selected from the candidate 4-item set as the frequent 4-item set; and this process is repeated until no new frequent item set can be generated; Among them, support Refers to the percentage of vehicles in the new traffic management data sample set that simultaneously meet both the "candidate feature variable" and "traffic accident occurred in the same year" conditions in the candidate items. The calculation formula is: , in, represents the candidate feature variables, Indicates the vehicles involved in traffic accidents that year. Represents the total number of vehicles in the new traffic management data sample set.
6. The method for mining association characteristics of private car traffic safety risk according to claim 1, characterized in that: The candidate association rule set is constructed based on the frequent item set, and all final association rules with confidence greater than a third threshold are screened out from the candidate association rule set to generate a final association rule set. include: Among them, the confidence Refers to the proportion of vehicles that were involved in traffic accidents in that year among all vehicles that meet one of the "candidate characteristic variables" in the candidate items. The calculation formula is: , in, represents the candidate feature variables, Indicates the vehicles involved in traffic accidents that year. Indicates the total number of vehicles that meet one of the "candidate feature variables" conditions in the candidate items.
Citation Information
Patent Citations
Road traffic accident form prediction method
CN113077625A