Private car traffic safety risk feature association mining method
Through the information entropy theory, numerical variables are discretized and frequent term search path constraints are added, which solves the problem of difficulty in identifying traffic safety risk characteristics of private cars in the existing technology, and achieves rapid and accurate risk characteristics identification and improves algorithm efficiency.
Patent Information
- Application Number
- CN202411797874.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-09
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2044-12-09
AI Technical Summary
When processing massive and high-dimensional private car traffic management data, it is difficult to quickly and accurately identify the traffic safety risk characteristics of private car traffic, and there are problems such as slow operation speed, overfitting, and frequent redundancy term generation.
The numerical variables are discretized through information entropy theory to generate a set of feature variables with high correlation with the target variable and low redundancy. By adding frequent term search path constraints, it avoids the generation of redundant frequent terms and improves the mining speed of association rules.
It realizes the rapid and accurate discovery of private car risk characteristics from massive private car traffic management data, reduces parameter search space, improves algorithm efficiency, and supports the traffic management department's hidden danger management and accident prevention work.
Smart Images

Figure CN119691026A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of road traffic safety and data mining, and more specifically, to a method for mining association of private car traffic safety risk characteristics. Background Art
[0002] In recent years, with the rapid development of the economy and the acceleration of urbanization, the number of private cars has increased dramatically, which has brought convenience to public travel, but traffic safety issues have also become increasingly prominent. Due to the complex interweaving of multiple factors such as private car drivers' driving habits, vehicle performance, and road environment, the traffic safety risk characteristics of private cars have become diversified and complex. Therefore, in-depth exploration of the traffic safety risk characteristics of private cars is of great significance for preventing traffic accidents and improving road safety levels.
[0003] The mining of private car traffic safety risk features refers to finding risk features that are likely to cause future traffic accidents from massive traffic management data such as basic vehicle attributes, basic vehicle owner attributes, and historical business handling, traffic violations, and traffic accidents of private cars. At present, there are two main types of private car traffic safety risk feature mining methods: one is the single factor analysis method based on statistics. This method associates candidate features with 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 joint impact of multiple factors on traffic accidents, resulting in the mined risk features being inaccurate and incomplete; the second is the multi-factor analysis method based on data mining, especially the association rule algorithm, which can combine features for analysis, thereby deeply exploring the mechanism of the combination of multiple factors on accidents, and finding association rules such as "feature 1 + feature 2 + feature 3 = > traffic accidents occurred that year", which has gradually become a research hotspot in this field.
[0004] However, there are four main problems when using traditional association rule algorithms to mine private car traffic safety risk characteristics:
[0005] (1) Private car traffic control data contains numerical variables such as the number of violations and the number of points for violations. When the value range of numerical variables is large, the association rule algorithm runs very slowly and has the problem of overfitting, so discretization processing is required in advance.
[0006] (2) The association rule algorithm uses permutation and combination traversal to select frequent items (features or feature combinations with sample size greater than a certain threshold). When there are too 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 nature, 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 mining of risk features that are irrelevant to whether traffic accidents are likely to occur in the future, and increasing the amount of model calculation. Among them, 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 in the previous year"; redundant association rules mainly refer to the rule consequence that does not contain the target variable, such as: "more than 10 violations in the previous year + traffic accidents occurred in the year => more than 5 illegal parking 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 private car hidden danger management and accident prevention work of the traffic management department.
[0011] As a first aspect of the present invention, a method for mining association of traffic safety risk characteristics of private cars is provided, comprising the following steps:
[0012] Step S1: obtaining an original traffic management data sample set, wherein the original traffic management data sample set 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 handling 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: taking the private car's own characteristic data, the private car owner's characteristic data, the private car traffic management business handling data, the private car's traffic violation data in the previous year, and the private car's traffic accident data in the previous year as characteristic variables, and taking whether the private car had a traffic accident in that year as the target variable;
[0014] 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;
[0015] 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;
[0016] 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;
[0017] 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 whose support is greater than a second threshold from the candidate item set to generate a frequent item set;
[0018] Step S7: constructing a candidate association rule set based on the frequent item set, and screening out 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 vector in the final association rule set is a feature variable with traffic safety risk.
[0019] Furthermore, the private car's own characteristic data include vehicle type, vehicle usage nature and vehicle fuel type, the private car owner's characteristic data include owner's gender, owner's age and owner's driving experience, the private car traffic management business handling data include vehicle transfer times, vehicle violation handling persons and accident parties, the private car traffic violation data in the previous year include the total number of vehicle violations, 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 include the number of vehicle simple procedure accidents, the number of vehicle general procedure injury accidents and the number of vehicle general procedure death accidents;
[0020] Among them, the vehicle type, vehicle usage nature, vehicle fuel type and owner's gender are all discrete characteristic variables; the owner's age, owner's driving experience, number of vehicle transfers, number of people handling vehicle violations, number of accident parties, 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.
[0021] Furthermore, the method of converting all numerical feature variables in the original traffic management data sample set into discrete feature variables by using a discretization binning method also includes:
[0022] 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 according to 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;
[0023] Among them, the information entropy H(S) of the target variable y in each subset after each initial partition point is divided v ) is calculated as follows:
[0024] H(S v )=-p v log2(p v )-(1-p v )log2(1-p v )
[0025] Among them, S v is a subset divided according to the initial partition point; p v is a subset S v The number of private cars involved in traffic accidents in that year accounts for the subset S v The proportion of private cars in the total number of
[0026] Among them, the calculation formula of the information gain IG(y,A) of the target variable y corresponding to each initial partition point is as follows:
[0027]
[0028] 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 vis 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;
[0029] Step S32: recursively execute the above step S31 for each subset divided by the optimal partition point to calculate the optimal partition point of 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;
[0030] Step S33: Convert each numerical feature variable into a discrete feature variable according to the optimal division point calculated last.
[0031] Furthermore, the step of selecting 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 with all candidate feature variables and the target variable in the original traffic management data sample set also includes:
[0032] The calculation formula of the importance IMP of each characteristic 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] 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;
[0035] Among them, avg(IG(F,A(x i ))) means that according to a certain characteristic variable x i After 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 value of a certain feature variable x. i The degree of redundancy between it and other candidate feature variables in the current candidate feature variable set F.
[0036] Furthermore, 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:
[0037] 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;
[0038] The dummy variable encoding uses a 1-bit status register to encode whether the vehicle has a traffic accident in 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 vehicles that are not involved in traffic accidents, the status register is in state 0.
[0039] Furthermore, the method of 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 whose support is greater than a second threshold from the candidate item set to generate a frequent item set, further includes:
[0040] Traverse the candidate feature variable numbers corresponding to the vehicles involved in the traffic accident that year, generate a candidate 2-item set of "a candidate feature variable + a traffic accident that occurred that year", and select all candidate 2-item sets with support greater than the second threshold from the candidate 2-item set as the frequent 2-item set;
[0041] The candidate feature variable numbers in the frequent 2-item set are arranged and combined to generate a candidate 3-item set of "candidate feature variable 1+candidate feature variable 2+traffic accidents that occurred in that year", and all candidate 3 items whose support is greater than the second threshold are selected from the candidate 3-item set as the frequent 3-item set;
[0042] The candidate feature variable numbers in the frequent three-item set are arranged and combined to generate a candidate four-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 four items with support greater than the second threshold are selected from the candidate four-item set as the frequent four-item set; and this process is repeated until a new frequent item set cannot be generated;
[0043] Among them, support Support(x,y (1) ) refers to the percentage of vehicles in the new traffic management data sample set that simultaneously meet the two conditions of "candidate characteristic variables" and "traffic accidents occurred in the same year" in the candidate items, and the calculation formula is:
[0044]
[0045] Among them, x represents the candidate feature variable, y (1) represents the vehicles involved in traffic accidents in that year, and Count(S) represents the total number of vehicles in the new traffic management data sample set.
[0046] Furthermore, the step of constructing a candidate association rule set according to the frequent item set, and selecting all final association rules with confidence greater than a third threshold from the candidate association rule set to generate a final association rule set, further includes:
[0047] Among them, the confidence Refers to the proportion of vehicles that had traffic accidents in that year among all vehicles that meet one of the "candidate characteristic variables" in the candidate items. The calculation formula is:
[0048]
[0049] Among them, x represents the candidate feature variable, y (1) It represents the vehicles involved in traffic accidents in that year, and Count(x) represents the total number of vehicles that meet one of the conditions of "candidate feature variables" in the candidate items.
[0050] The private car traffic safety risk feature association mining method provided by the present invention has the following advantages:
[0051] (1) Based on the information entropy theory, the numerical variables are discretized and a set of feature variables with high correlation and low redundancy with the target variable is generated, so as to reduce the parameter search space and improve the efficiency of the algorithm;
[0052] (2) By adding frequent item search path constraints, we can avoid generating redundant frequent items and improve the speed of association rule mining, so as to achieve the goal of quickly and accurately discovering the risk characteristics of private cars from massive private car traffic management data. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] The accompanying drawings are used to provide further understanding of the present invention and constitute a part of the specification. Together with the following specific embodiments, they are used to explain the present invention, but do not constitute a limitation of the present invention.
[0054] Figure 1 A flow chart of the private car traffic safety risk feature association mining method provided by the present invention.
[0055] Figure 2 A flowchart of a specific implementation method of the private car traffic safety risk feature association mining method provided by the present invention. DETAILED DESCRIPTION
[0056] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the specific implementation method, structure, characteristics and effects of the private car traffic safety risk feature association mining method proposed by the present invention are described in detail below in combination with the accompanying drawings and preferred embodiments. Obviously, the described embodiments are part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work belong to the protection scope of the present invention.
[0057] In this embodiment, a private car traffic safety risk feature association mining method is provided. Figure 1 As shown, the private car traffic safety risk feature association mining method includes:
[0058] Step S1: obtaining an original traffic management data sample set, wherein the original traffic management data sample set 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 handling 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;
[0059] Preferably, the private car's own characteristic data include vehicle type, vehicle usage nature, vehicle fuel type, vehicle age, vehicle number of seats, etc., the private car owner's characteristic data include the owner's gender, the owner's age, the owner's driving experience, the owner's permitted vehicle type, the private car traffic management business handling data include the number of vehicle transfers, the number of vehicle violation handling persons and the number of accident parties, the private car's traffic violation data in the previous year include the total number of vehicle violations, the vehicle violation score and the number of various types of key vehicle violations investigated and dealt with (including: drunk driving, overloading, speeding, fatigue driving, driving without a license, running red lights, driving in the wrong direction, illegal lane changes, illegal overtaking, illegal U-turns, illegal driving on the road, failure to stop and give way, etc.), the private car's traffic accident data in the previous year include the number of vehicle simple procedure accidents, the number of vehicle general procedure injury accidents and the number of vehicle general procedure death accidents;
[0060] Among them, the vehicle type, vehicle usage nature, vehicle fuel type and owner's gender are all discrete characteristic variables; the owner's age, owner's driving experience, number of vehicle transfers, number of people handling vehicle violations, number of accident parties, 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.
[0061] Step S2: taking the private car's own characteristic data, the private car owner's characteristic data, the private car traffic management business handling data, the private car's traffic violation data in the previous year, and the private car's traffic accident data in the previous year as characteristic variables, and taking whether the private car had a traffic accident in that year as the target variable;
[0062] 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;
[0063] Preferably, if Figure 2 As shown, the method of converting all numerical feature variables in the original traffic management data sample set into discrete feature variables by using a discretization binning method also includes:
[0064] 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 according to 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;
[0065] Among them, the information entropy H(S) of the target variable y in each subset after each initial partition point is divided v ) is calculated as follows:
[0066] H(S v )=-p v log2(p v )-(1-p v )log2(1-p v )
[0067] Among them, S v is a subset divided according to the initial partition point; p v is a subset S v The number of private cars involved in traffic accidents in that year accounts for the subset S v The proportion of private cars in the total number of
[0068] Among them, 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 the above step S31 on each subset divided by the optimal partition point to calculate the optimal partition point of each subset, until the number of bins is greater than the fourth threshold (for example, 5 bins) or the increment of information gain is less than the fifth threshold (for example, 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 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 with all candidate feature variables and target variables in the original traffic management data sample set, further includes:
[0075] The calculation formula of the importance 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 ))) means 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 value of a certain feature variable x. i The degree of redundancy between it and other candidate feature variables in the current candidate feature variable set F.
[0079] For example, if the importance of a 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 put into the set F to generate a new traffic management data sample set.
[0080] 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;
[0081] It should be noted that category encoding is used to distinguish candidate feature variables from target variables, and the one-hot encoding (One-Hot Encoding) of candidate feature variables and the dummy variable encoding (DummyVariable Encoding) of target variables are used to mark variable values.
[0082] Preferably, 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 comprises:
[0083] 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;
[0084] The dummy variable encoding uses a 1-bit status register to encode whether the vehicle has a traffic accident in 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 vehicles that are not involved in traffic accidents, the status register is in state 0.
[0085] 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 whose support is greater than a second threshold from the candidate item set to generate a frequent item set;
[0086] Preferably, if Figure 2 As shown, in step S6, the method of generating a frequent item set is:
[0087] First, initialize the total set of frequent items L = {}, then set k = 2, and combine the items whose target variable dummy variable encoding value is 1 with the items whose one-hot encoding value is 1 of each candidate feature variable in turn, and select the combination items with support greater than 5% as the frequent k-item set l k ;
[0088] If the frequent k-item set l k is an empty set, the algorithm ends and no risk feature variable is found; if the frequent k-item set l k If it is not an empty set, add the frequent k-item set l k to the total set L, and repeat the following steps until no new frequent item set can be generated: k The candidate feature variables in each frequent k item are self-connected (combined in pairs) to generate candidate k+1 items containing the target variable, and the combination items with support greater than 5% are selected as the frequent k+1 item set l k+1 , then let k=k+1.
[0089] Specifically, the step S6 further includes:
[0090] Traverse the candidate feature variable numbers corresponding to the vehicles involved in the traffic accident that year, generate a candidate 2-item set of "a candidate feature variable + a traffic accident that occurred that year", and select all candidate 2-item sets with support greater than the second threshold from the candidate 2-item set as the frequent 2-item set;
[0091] The candidate feature variable numbers in the frequent 2-item set are arranged and combined to generate a candidate 3-item set of "candidate feature variable 1+candidate feature variable 2+traffic accidents that occurred in that year", and all candidate 3 items whose support is greater than the second threshold are selected from the candidate 3-item set as the frequent 3-item set;
[0092] The candidate feature variable numbers in the frequent three-item set are arranged and combined to generate a candidate four-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 four items with support greater than the second threshold are selected from the candidate four-item set as the frequent four-item set; and this process is repeated until a new frequent item set cannot be generated;
[0093] Among them, support Support(x,y (1) ) refers to the percentage of vehicles in the new traffic management data sample set that simultaneously meet the two conditions of "candidate characteristic variables" and "traffic accidents occurred in the same year" in the candidate items, and the calculation formula is:
[0094]
[0095] Among them, x represents the candidate feature variable, y(1) represents the vehicles involved in traffic accidents in that year, and 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 based on the frequent item set, and screening out 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 vector in the final association rule set is a feature variable with traffic safety risk.
[0097] Preferably, the step of constructing a candidate association rule set according to the frequent item set, and selecting all final association rules with confidence greater than a third threshold from the candidate association rule set to generate a final association rule set further includes:
[0098] For each frequent item in the frequent item set, a candidate association rule with the candidate characteristic variable as the antecedent and the target variable as the consequent 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; the antecedent in the final association rule is the characteristic variable with traffic safety risk;
[0099] Among them, the confidence It is a standard for measuring the reliability of candidate association rules. It represents the proportion of vehicles that have traffic accidents in the year among all vehicles that meet one condition of the "candidate feature variable" in the candidate. The calculation formula is:
[0100]
[0101] Among them, x represents the candidate feature variable, y (1) It represents the vehicles involved in traffic accidents in that year, and Count(x) represents the total number of vehicles that meet one of the conditions of "candidate feature variables" in the candidate items.
[0102] The private car traffic safety risk feature association mining method provided by the present invention applies information entropy theory to discretize numerical variables, finds a set of feature variables with high correlation and low redundancy with the target variable, and improves the association rule algorithm by adding search path constraints, so as to realize fast and accurate discovery of private car risk features from massive and high-dimensional private car traffic management data, and provide support for the private car hidden danger management and accident prevention work of the traffic management department.
[0103] The method for mining private car traffic safety risk characteristics association provides the following advantages: (1) in view of the disadvantage that the performance of the association rule algorithm is reduced when processing continuous variables and high-dimensional sample data, the present invention discretizes the numerical variables based on the information entropy theory, and generates a set of characteristic variables with high correlation and low redundancy with the target variable, thereby reducing the parameter search space and improving the algorithm efficiency; (2) in view of the disadvantage that the traversal search of frequent items in the association rule algorithm is inefficient, the present invention can avoid generating redundant frequent items by adding frequent item search path constraints, and improve the association rule mining speed, thereby achieving the purpose of quickly and accurately discovering private car risk characteristics from massive private car traffic management data.
[0104] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any form. Although the present invention has been disclosed as a preferred embodiment as above, it is not used to limit the present invention. Any technician familiar with this profession can make some changes or modifications to equivalent embodiments of equivalent changes using the technical contents disclosed above without departing from the scope of the technical solution of the present invention. However, any simple modification, equivalent change and modification made to the above embodiments based on the technical essence of the present invention without departing from the content of the technical solution of the present invention still falls within the scope of the technical solution of the present invention.
Claims
1. A method for mining association characteristics of private car traffic safety risk, characterized in that: The following steps are involved: Step S1: obtaining an original traffic management data sample set, wherein the original traffic management data sample set 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 handling 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: taking the private car's own characteristic data, the private car owner's characteristic data, the private car traffic management business handling data, the private car's traffic violation data in the previous year, and the private car's traffic accident data in the previous year as characteristic variables, and taking whether the private car had a traffic accident in that year 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 whose support is 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 out 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 vector in the final association rule set is a feature variable with traffic safety risk.
2. The private car traffic safety risk feature association mining method according to claim 1 is characterized in that: The private car's own characteristic data include vehicle type, vehicle usage nature and vehicle fuel type; the private car owner's characteristic data include the owner's gender, age and driving experience; the private car traffic management business handling data include the number of vehicle transfers, the number of persons handling vehicle violations and the number of parties involved in accidents; the private car's traffic violation data in the previous year include 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's traffic accident data in the previous year include the number of vehicle simple procedure accidents, the number of vehicle general procedure injury accidents and the number of vehicle general procedure death accidents; Among them, the vehicle type, vehicle usage nature, vehicle fuel type and owner's gender are all discrete characteristic variables; the owner's age, owner's driving experience, number of vehicle transfers, number of people handling vehicle violations, number of accident parties, 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 private car traffic safety risk feature association mining method according to claim 1 is characterized in that: The method of converting all numerical feature variables in the original traffic management data sample set into discrete feature variables by using a discretization binning method also 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 according to 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 H(S) of the target variable y in each subset after each initial partition point is divided v ) is calculated as follows: H(S v )=-p v log2(p v )-(1-p v )log2(1-p v ) Among them, S v is a subset divided according to the initial partition point; p v is a subset S v The number of private cars involved in traffic accidents in that year accounts for the subset S v The proportion of private cars in the total number of Among them, the calculation formula of the information gain IG(y,A) of the target variable y corresponding to each initial partition point is as follows: 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; Step S32: recursively execute the above step S31 for each subset divided by the optimal partition point to calculate the optimal partition point of 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 private car traffic safety risk characteristics according to claim 3 is characterized in that: The step of selecting 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 with all candidate feature variables and target variables in the original traffic management data sample set also includes: The calculation formula of the importance IMP of each characteristic variable in the original traffic management data sample set is as follows: IMP=IG(y,A(x i ))÷avg(IG(F,A(x i ))) 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; Among them, avg(IG(F,A(x i ))) means that according to a certain characteristic variable x i After 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 value of a certain feature variable x. i The degree of redundancy between it and other candidate feature variables in the current candidate feature variable set F.
5. The private car traffic safety risk feature association mining method according to claim 1 is 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 a traffic accident in 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 vehicles that are not involved in traffic accidents, the status register is in state 0.
6. The private car traffic safety risk feature association mining method according to claim 1 is characterized in that: The method of 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 whose support is greater than a second threshold from the candidate item set to generate a frequent item set, further includes: Traverse the candidate feature variable numbers corresponding to the vehicles involved in the traffic accident that year, generate a candidate 2-item set of "a candidate feature variable + a traffic accident that occurred that year", and select all candidate 2-items with support greater than the second threshold from the candidate 2-item set as the frequent 2-item set; The candidate feature variable numbers in the frequent 2-item set are arranged and combined to generate a candidate 3-item set of "candidate feature variable 1+candidate feature variable 2+traffic accidents that occurred in that year", and all candidate 3 items whose support is greater than the second threshold are selected from the candidate 3-item set as the frequent 3-item set; The candidate feature variable numbers in the frequent three-item set are arranged and combined to generate a candidate four-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 four items with support greater than a second threshold are selected from the candidate four-item set as the frequent four-item set; and this process is repeated until a new frequent item set cannot be generated; Among them, support Support(x,y (1) ) refers to the percentage of vehicles in the new traffic management data sample set that simultaneously meet the two conditions of "candidate characteristic variables" and "traffic accidents occurred in the same year" in the candidate items, and the calculation formula is: Among them, x represents the candidate feature variable, y (1) represents the vehicles involved in traffic accidents in that year, and Count(S) represents the total number of vehicles in the new traffic management data sample set.
7. The private car traffic safety risk feature association mining method according to claim 1 is characterized in that: The candidate association rule set is constructed according to 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 had traffic accidents in the year among all vehicles that meet one of the "candidate characteristic variables" in the candidate items. The calculation formula is: Among them, x represents the candidate feature variable, y (1) It represents the vehicles involved in traffic accidents in that year, and Count(x) represents the total number of vehicles that meet one of the "candidate feature variables" in the candidate items.
Citation Information
Patent Citations
Traffic accident cause excavation method based on universality meta-rules
CN108717786A
Road traffic accident form prediction method
CN113077625A
Traffic control scene determination method and device, electronic equipment and storage medium
CN116013084A
Road section sudden traffic incident prediction system and method based on Apriori algorithm
CN117079462A