Data association analysis method and system based on weight improved Apriori
By introducing weight calculation and new indicator algorithms into the Apriori algorithm, the problem of traditional methods failing to consider the severity of the accident is solved, and more efficient and accurate railway accident data analysis is achieved, which improves the safety of the railway system.
Patent Information
- Application Number
- CN202411430479.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-14
- Publication Date
- 2025-03-14
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Traditional data analysis methods and Apriori algorithm fail to effectively consider the severity of the accident when processing railway accident data, resulting in poor reliability of the analysis results and unable to effectively support the formulation of accident prevention and emergency response strategies.
The Apriori algorithm based on weight improvement is adopted to calculate the weight of the accident level through the entropy value method, and a new support degree and confidence index algorithm is designed to obtain more strong correlation rules containing the cause of accidents.
It improves the effectiveness of railway accident data mining, improves the efficiency and accuracy of accident and fault analysis and prevention, and effectively ensures the driving safety of the railway system.
Smart Images

Figure CN119622234A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of railway safety data mining; in particular, to a data association analysis method and system based on weight-improved Apriori. Background Art
[0002] Railway safety is the top priority of railway transportation production, operation and management. In the field of railway transportation, the prevention and analysis of accidents and failures are important links to ensure driving safety. With the increase in railway transportation volume and the complexity of the transportation system, the accumulation of accident data is also growing continuously. How to mine valuable information from massive data and realize early warning and prevention of accidents has become an important task in railway safety management.
[0003] Traditional data analysis methods mainly rely on manual analysis. Due to the lack of systematic data processing and analysis tools, they are often unable to accurately identify the potential causes and correlation patterns of accidents, and are time-consuming and inefficient.
[0004] In addition, although traditional association rule mining methods such as the Apriori algorithm are widely used in many fields, their application effect is also limited in railway accident data analysis because they fail to consider the severity and actual impact of the accident. When mining frequent item sets, the traditional Apriori algorithm usually assumes that all items are equally important.
[0005] However, in the analysis of railway accident data, some large and serious accidents (such as those related to casualties) are obviously more important than other general accidents (such as simple equipment failures). Therefore, this equal-weighted processing method is difficult to reflect the true importance of accident data, and the reliability of accident data analysis is poor, resulting in the inability of the analysis results to effectively support the formulation of accident prevention and emergency response strategies.
[0006] In summary, traditional data analysis methods face many difficulties and challenges when processing unstructured railway accident data at this stage.
[0007] Therefore, there is an urgent need to develop a method to efficiently and accurately analyze railway accident data, taking into account the severity of the accident, and improving the quality and reliability of accident data analysis; supporting the generation of association rules with practical application value, which can be used for early warning and prevention of railway accidents, and help railway managers identify the potential risks and true causes of accidents, so as to better manage risks and ensure safety. Summary of the invention
[0008] In view of this, the purpose of the present invention is to propose a data association analysis method and system based on weighted improved Apriori, use the entropy method to determine the weight of the accident level, design a new support and confidence index algorithm, and obtain more strong association rules containing accident cause information to solve the problem that the traditional Apriori algorithm does not consider the severity of the accident when processing railway accident data, improve the effectiveness of railway accident data mining, improve the efficiency and accuracy of accident and fault analysis and prevention, and effectively ensure the driving safety of the railway system.
[0009] The present invention provides a data association analysis method based on weight-improved Apriori, comprising the following steps:
[0010] S1. Collect original railway accident data, filter and number the information on railway accident causes, accident types, and accident levels, and generate a multi-attribute railway accident dataset;
[0011] S2: Calculate the weight of accident data based on entropy method;
[0012] The S2 step includes the following steps: S21. Standardize the original railway accident data to eliminate the influence of different data indicator dimensions. The standardized calculation expression is: (1)
[0013] In formula (1), X ij is the jth index value of the i-th accident level, X min and X max are the minimum and maximum values of the j-th indicator respectively;
[0014] S22. Calculate the proportion matrix of each standardized indicator in each accident level. The calculation expression of the proportion matrix is: (2)
[0015] In formula (2), Z ij is the normalized accident data value;
[0016] S23, calculating the entropy value of each indicator, using the entropy value to reflect the amount of information of each indicator, the calculation expression of the entropy value of the indicator is: (3);
[0017] In formula (3), , n is the number of samples;
[0018] S24. Calculate the coefficient of difference of each indicator by using the entropy value. The calculation expression of the coefficient of difference is: (4)
[0019] S25. Calculate the weight of each indicator according to the difference coefficient. The calculation expression of the weight of each indicator is: (5)
[0020] In formula (5), m is the index number;
[0021] S26, multiplying the standardized data by the corresponding indicator weight, and summing them to obtain the total weight of each accident level;
[0022] S3. According to the weight of the accident data calculated based on the entropy method, the improved support and confidence indicators are set to mine the association rules in the railway accident data.
[0023] Furthermore, the S3 step includes the following steps:
[0024] S31. According to the weights calculated by the entropy method and in combination with the goal of association analysis, set the minimum weighted support and minimum weighted confidence indicators;
[0025] The setting of the minimum weighted support and minimum weighted confidence indicators is the basis for subsequent frequent item set mining and the generation of strong association rules; the number of association rules calculated will be different if the minimum weighted support and minimum weighted confidence are set differently.
[0026] S32, scanning the multi-attribute railway accident data set, and generating a candidate item set C of k items from the multi-attribute railway accident data set k , k starts from 1, and the candidate item set C is calculated k The weighted support of each item set in , delete the item sets below the minimum weighted support threshold, and form a frequent item set L k ; The frequent item set L k Combine the elements in to generate a candidate item set C of k+1 items k+1 ;
[0027] S33, repeat step S32 until the following conditions are met: the frequent item sets cannot be combined to generate a larger candidate item set, and / or the weighted support of all candidate item sets is lower than the specified minimum weighted support threshold. When the frequent item set cannot be generated, the weighted support calculation is terminated and step S34 is entered;
[0028] S34, calculating the frequent item set L k The weighted confidence of each rule in is used to filter out strong association rules whose weighted confidence is not less than the minimum weighted confidence threshold.
[0029] For example, the minimum weighted support is set to 0.01 and the minimum weighted confidence is set to 0.1. The association rule mining is performed on the two fields of "accident cause" and "accident type" in the multi-attribute railway accident data set, and the weighted confidence of each rule in the frequent item set is calculated to screen out strong association rules whose weighted confidence is not less than the minimum weighted confidence threshold.
[0030] By analyzing the strong association rules mined, high-risk behaviors can be accurately identified, so that targeted preventive measures can be taken. For example, warning signs and monitoring equipment can be added in accident-prone areas, and fences and protective facilities along the railway can be strengthened to achieve accident warning and prevention effects.
[0031] Furthermore, the calculation C in step S32 is k The calculation expression of the weighted support of each item set in is: (6)
[0032] In formula (6), W i is the weight of the i-th transaction; is the indicator function. When item set X and item set Y appear in transaction i at the same time, The value of is 1; when item set X and item set Y do not appear in transaction i at the same time, The value of is 0; is the sum of the weights of all transactions.
[0033] In the present invention, weighted support is used to measure the frequency of occurrence of itemsets in a data set, taking into account the weight of each accident.
[0034] Furthermore, the calculation expression for calculating the weighted confidence of each rule in the frequent item set in step S34 is: (7)
[0035] In formula (7), (8)
[0036] In formula (8), is the indicator function. When item set X appears in transaction i, The value of is 1, when item set X does not appear in transaction i, The value of is 0.
[0037] In the present invention, the weighted confidence is used to measure the credibility of the association rules.
[0038] Furthermore, the method of screening and numbering the information of the railway accident cause, accident type, and accident level in step S1 to generate a multi-attribute railway accident data set includes:
[0039] With reference to domestic and foreign railway accident cause classification models, the causal factors in four aspects, namely personnel, equipment, environment and management, were identified and numbered to construct a multi-attribute railway accident dataset.
[0040] For example, the numbers and categories of some accident causative factors are shown in Table 1.
[0041] Table 1 Numbers and categories of some accident-causing factors
[0042] The present invention also provides a data association analysis system based on weight-improved Apriori, which executes the data association analysis method based on weight-improved Apriori as described above, including:
[0043] Railway accident data set construction and data preprocessing module: used to collect original railway accident data, screen and number the information on railway accident causes, accident types, and accident levels, and generate a multi-attribute railway accident data set;
[0044] Weight calculation module based on entropy method: used to calculate the weight of accident data based on entropy method;
[0045] Improved association rule mining algorithm module: used to set improved support and confidence indicators according to the weight of the accident data calculated based on the entropy method, and mine association rules in railway accident data;
[0046] Wherein, the weight calculation module based on the entropy method includes:
[0047] Standardization unit: used to standardize the original railway accident data and eliminate the impact of different data indicator dimensions;
[0048] Calculation ratio matrix unit: used to calculate the ratio matrix of each standardized indicator in each accident level;
[0049] Entropy value calculation unit: used to calculate the entropy value of each indicator, and use the entropy value to reflect the information amount of each indicator;
[0050] A difference coefficient calculation unit is used to calculate the difference coefficient of each indicator through the entropy value;
[0051] An indicator weight calculation unit: used to calculate the weight of each indicator according to the difference coefficient;
[0052] Calculation unit for total accident level weight: used to multiply the standardized data by the corresponding indicator weight, and sum up to obtain the total weight of each accident level.
[0053] Furthermore, the improved association rule mining algorithm module includes:
[0054] Setting minimum weighted support and confidence index unit: used to set the minimum weighted support and minimum weighted confidence index according to the weights calculated by the entropy method and the goal of association analysis;
[0055] Generate frequent item set unit: used to scan the multi-attribute railway accident data set and generate k-item candidate item set C from the multi-attribute railway accident data set k , k starts from 1, and the candidate item set C is calculated k The weighted support of each item set in , delete the item sets below the minimum weighted support threshold, and form a frequent item set L k ;
[0056] Weighted support calculation unit: used to repeatedly run step S32 until the following conditions are met: frequent item sets cannot be combined to generate a larger candidate item set, and / or the weighted support of all candidate item sets is lower than the specified minimum weighted support threshold. When frequent item sets cannot be generated, the weighted support calculation is terminated and step S34 is entered;
[0057] Calculation weighted confidence unit: used to calculate the frequent item set L k The weighted confidence of each rule in is used to filter out strong association rules whose weighted confidence is not less than the minimum weighted confidence threshold.
[0058] The present invention also provides a computer-readable storage medium having a computer program stored thereon, and when the program is executed by a processor, the steps of the data association analysis method based on weight-improved Apriori as described above are implemented.
[0059] The present invention also provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the steps of the data association analysis method based on weight-improved Apriori as described above are implemented.
[0060] Compared with the prior art, the present invention has the following beneficial effects:
[0061] The data association analysis method and system based on weighted improved Apriori provided by the present invention calculate the weight of each accident level through the entropy method, improve the traditional Apriori algorithm, design a new support and confidence index calculation method, obtain more strong association rules containing accident cause information, realize weighted association rule mining of railway accident data, solve the problem that the traditional Apriori algorithm does not consider the severity of the accident when processing railway accident data, improve the effectiveness of railway accident data mining, improve the efficiency and accuracy of accident and fault analysis and prevention, and effectively ensure the driving safety of the railway system. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the following detailed description of the preferred embodiment.The drawings are only for the purpose of illustrating the preferred embodiments and are not to be construed as limiting the invention.
[0063] In the attached picture:
[0064] Figure 1 A basic structural diagram of a data association analysis system based on weighted improved Apriori provided by an embodiment of the present invention;
[0065] Figure 2 This is a flow chart of determining the weight corresponding to the accident level based on the entropy method according to an embodiment of the present invention;
[0066] Figure 3 A flowchart of the weight-improved Apriori algorithm according to an embodiment of the present invention;
[0067] Figure 4 It is a flow chart of the data association analysis method based on weight-based improved Apriori of the present invention;
[0068] Figure 5 It is a flow chart of step S2 of the data association analysis method based on weight-improved Apriori of the present invention;
[0069] Figure 6 It is a flow chart of step S3 of the data association analysis method based on weight-improved Apriori of the present invention;
[0070] Figure 7 The figure is a schematic diagram of the structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0071] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and products consistent with some aspects of the present disclosure as detailed in the appended claims.
[0072] The terms used in this disclosure are for the purpose of describing specific embodiments only and are not intended to limit the disclosure. The singular forms of "a", "said" and "the" used in this disclosure and the appended claims are also intended to include plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0073] It should be understood that although the terms first, second, third, etc. may be used in the present disclosure to describe various information, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present disclosure, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0074] The embodiments of the present invention are described in further detail below.
[0075] The embodiment of the present invention provides a data association analysis method based on weight-improved Apriori, see Figure 4 As shown, the following steps are included:
[0076] S1. Collect original railway accident data, filter and number the information on railway accident causes, accident types, and accident levels, and generate a multi-attribute railway accident dataset;
[0077] Preferably, the method for screening and numbering the information of railway accident causes, accident types, and accident levels to generate a multi-attribute railway accident data set includes:
[0078] With reference to domestic and foreign railway accident cause classification models, the causal factors in four aspects, namely personnel, equipment, environment and management, were identified and numbered to construct a multi-attribute railway accident dataset.
[0079] In this embodiment, the numbers and categories of accident-causing factors such as some personnel, equipment, environment and management types are shown in Table 1.
[0080] Table 1 Numbers and categories of some accident-causing factors
[0081] S2: Calculate the weight of accident data based on entropy method;
[0082] In this embodiment, the entropy method is used to calculate the weight of each accident level to ensure the objectivity of weight distribution. The process of calculating the weight using the entropy method is as follows: Figure 2 shown.
[0083] According to the Regulations on Emergency Rescue, Investigation and Handling of Railway Traffic Accidents, accidents are divided into four levels: extremely serious accidents, serious accidents, major accidents and general accidents.
[0084] Specifically, the basis for the classification of railway accident levels is as follows:
[0085] Define the indicators corresponding to each accident level:
[0086] 1) Number of deaths;
[0087] 2) Number of seriously injured;
[0088] 3) Direct economic losses;
[0089] 4) Derailment of passenger trains;
[0090] 5) Freight train derailment;
[0091] 6) Railway operation interruption time;
[0092] Construct the decision matrix shown in Table 2: Table 2
[0093] The railway accident levels are divided based on the decision matrix shown in Table 2.
[0094] In this embodiment, based on the entropy method, calculating the weight of accident data includes the following steps (see Figure 5 shown):
[0095] S21. Standardize the original railway accident data to eliminate the influence of different data indicator dimensions. The standardized calculation expression is: (1)
[0096] In formula (1), X ij is the jth index value of the i-th accident level, X min and X max are the minimum and maximum values of the j-th indicator respectively;
[0097] S22. Calculate the proportion matrix of each standardized indicator in each accident level. The calculation expression of the proportion matrix is: (2)
[0098] In formula (2), Z ij is the normalized accident data value;
[0099] S23, calculating the entropy value of each indicator, using the entropy value to reflect the amount of information of each indicator, the calculation expression of the entropy value of the indicator is: (3);
[0100] In formula (3), , n is the number of samples;
[0101] S24. Calculate the coefficient of difference of each indicator by using the entropy value. The calculation expression of the coefficient of difference is: (4)
[0102] S25. Calculate the weight of each indicator according to the difference coefficient. The calculation expression of the weight of each indicator is: (5)
[0103] In formula (5), m is the index number;
[0104] In this embodiment, the weights of various indicators calculated are shown in Table 3: Table 3
[0105] S26, multiplying the standardized data by the corresponding indicator weight, and summing them to obtain the total weight of each accident level;
[0106] In this embodiment, the calculated weight of each accident level is shown in Table 4: Table 4
[0107] S3. According to the weight of the accident data calculated based on the entropy method, the improved support and confidence indicators are set to mine the association rules in the railway accident data.
[0108] The S3 step includes the following steps (see Figure 6 shown):
[0109] S31. According to the weights calculated by the entropy method and in combination with the goal of association analysis, set the minimum weighted support and minimum weighted confidence indicators;
[0110] The setting of the minimum weighted support and minimum weighted confidence indicators is the basis for subsequent frequent item set mining and the generation of strong association rules; the number of association rules calculated will be different if the minimum weighted support and minimum weighted confidence are set differently.
[0111] S32, scanning the multi-attribute railway accident data set, and generating a candidate item set C of k items from the multi-attribute railway accident data set k , k starts from 1, and the candidate item set C is calculated k The weighted support of each item set in , delete the item sets below the minimum weighted support threshold, and form a frequent item set L k ; The frequent item set L k Combine the elements in to generate a candidate item set C of k+1 items k+1 ;
[0112] Calculate C k The calculation expression of the weighted support of each item set in is: (6)
[0113] In formula (6), W i is the weight of the i-th transaction; is the indicator function. When item set X and item set Y appear in transaction i at the same time, The value of is 1; when item set X and item set Y do not appear in transaction i at the same time, The value of is 0; is the sum of the weights of all transactions.
[0114] S33, repeat step S32 until the following conditions are met: the frequent item sets cannot be combined to generate a larger candidate item set, and / or the weighted support of all candidate item sets is lower than the specified minimum weighted support threshold. When frequent item sets cannot be generated, the weighted support calculation is terminated (e.g. Figure 3 As shown), enter step S34;
[0115] S34, calculating the frequent item set L k The weighted confidence of each rule in is used to filter out strong association rules whose weighted confidence is not less than the minimum weighted confidence threshold.
[0116] The calculation expression for calculating the weighted confidence of each rule in the frequent item set is: (7)
[0117] In formula (7), (8)
[0118] In formula (8), is the indicator function. When item set X appears in transaction i, The value of is 1, when item set X does not appear in transaction i, The value of is 0.
[0119] In this embodiment, the minimum weighted support is set to 0.01 and the minimum weighted confidence is set to 0.1. The association rules of the two fields "cause of accident" and "type of accident" in the multi-attribute railway accident data set are mined, and the weighted confidence of each rule in the frequent item set is calculated to screen out the strong association rules whose weighted confidence is not less than the minimum weighted confidence threshold. Some strong association rules are shown in Table 5.
[0120] Table 5
[0121] According to the strong association rules mined in Table 4, train collision accidents are often caused by pedestrians walking, sitting, lying, crossing, or passing through the station on the line. By analyzing these association rules, high-risk behaviors can be accurately identified, so that targeted preventive measures can be taken, such as adding warning signs and monitoring equipment in accident-prone areas, strengthening the construction of fences and protective facilities along the railway, etc., to achieve the effect of accident warning and prevention.
[0122] The embodiment of the present invention also provides a data association analysis system based on weight-improved Apriori, which executes the data association analysis method based on weight-improved Apriori as described above, including:
[0123] Railway accident data set construction and data preprocessing module: used to collect original railway accident data, screen and number the information on railway accident causes, accident types, and accident levels, and generate a multi-attribute railway accident data set;
[0124] Weight calculation module based on entropy method: used to calculate the weight of accident data based on entropy method;
[0125] Improved association rule mining algorithm module: used to set improved support and confidence indicators according to the weight of the accident data calculated based on the entropy method, and mine association rules in railway accident data;
[0126] Wherein, the weight calculation module based on the entropy method includes:
[0127] Standardization unit: used to standardize the original railway accident data and eliminate the impact of different data indicator dimensions;
[0128] Calculation ratio matrix unit: used to calculate the ratio matrix of each standardized indicator in each accident level;
[0129] Entropy value calculation unit: used to calculate the entropy value of each indicator, and use the entropy value to reflect the information amount of each indicator;
[0130] A difference coefficient calculation unit is used to calculate the difference coefficient of each indicator through the entropy value;
[0131] An indicator weight calculation unit: used to calculate the weight of each indicator according to the difference coefficient;
[0132] Calculation unit for total accident level weight: used to multiply the standardized data by the corresponding indicator weight, and sum up to obtain the total weight of each accident level.
[0133] The improved association rule mining algorithm module includes:
[0134] Setting minimum weighted support and confidence index unit: used to set the minimum weighted support and minimum weighted confidence index according to the weights calculated by the entropy method and the goal of association analysis;
[0135] Generate frequent item set unit: used to scan the multi-attribute railway accident data set and generate k-item candidate item set C from the multi-attribute railway accident data set k , k starts from 1, and the candidate item set C is calculated k The weighted support of each item set in , delete the item sets below the minimum weighted support threshold, and form a frequent item set L k ;
[0136] Weighted support calculation unit: used to repeatedly run step S32 until the following conditions are met: frequent item sets cannot be combined to generate a larger candidate item set, and / or the weighted support of all candidate item sets is lower than the specified minimum weighted support threshold. When frequent item sets cannot be generated, the weighted support calculation is terminated and step S34 is entered;
[0137] Calculation weighted confidence unit: used to calculate the frequent item set L k The weighted confidence of each rule in is used to filter out strong association rules whose weighted confidence is not less than the minimum weighted confidence threshold.
[0138] Figure 1 The basic structure of the data association analysis system based on weight-improved Apriori of this embodiment is shown.
[0139] An embodiment of the present invention further provides a computer device, Figure 7 is a schematic diagram of the structure of a computer device provided by an embodiment of the present invention; see the accompanying drawings Figure 7 As shown, the computer device includes: an input device 23, an output device 24, a memory 22 and a processor 21; the memory 22 is used to store one or more programs; when the one or more programs are executed by the one or more processors 21, the one or more processors 21 implement the data association analysis method based on weight-improved Apriori as provided in the above embodiment; wherein the input device 23, the output device 24, the memory 22 and the processor 21 can be connected by a bus or other means, Figure 7 The example of connecting through bus is taken in the following.
[0140] The memory 22 is a readable and writable storage medium of a computing device, which can be used to store software programs, computer executable programs, such as program instructions corresponding to the data association analysis method based on weight-improved Apriori described in the embodiment of the present invention; the memory 22 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, at least one application required for a function; the data storage area may store data created according to the use of the device, etc.; in addition, the memory 22 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device; in some instances, the memory 22 may further include a memory remotely arranged relative to the processor 21, and these remote memories may be connected to the device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0141] The input device 23 may be used to receive input digital or character information, and to generate key signal input related to user settings and function control of the device; the output device 24 may include a display device such as a display screen.
[0142] The processor 21 executes various functional applications and data processing of the device by running the software programs, instructions and modules stored in the memory 22, that is, implements the above-mentioned data association analysis method based on weight-improved Apriori.
[0143] The computer device provided above can be used to execute the data association analysis method based on weight-improved Apriori provided in the above embodiment, and has corresponding functions and beneficial effects.
[0144] The embodiment of the present invention also provides a storage medium containing computer executable instructions, which are used to perform the data association analysis method based on weight-improved Apriori as provided in the above embodiment when executed by a computer processor. The storage medium is any of various types of memory devices or storage devices, and the storage medium includes: installation media, such as CD-ROM, floppy disk or tape device; computer system memory or random access memory, such as DRAM, DDRRAM, SRAM, EDO RAM, Rambus RAM, etc.; non-volatile memory, such as flash memory, magnetic media (such as hard disk or optical storage); registers or other similar types of memory elements, etc.; the storage medium may also include other types of memory or combinations thereof; in addition, the storage medium may be located in a first computer system in which the program is executed, or may be located in a different second computer system, the second computer system is connected to the first computer system via a network (such as the Internet); the second computer system may provide program instructions to the first computer for execution. The storage medium includes two or more storage media that can reside in different locations (for example, in different computer systems connected via a network). The storage medium can store program instructions (for example, specifically implemented as a computer program) that can be executed by one or more processors.
[0145] Of course, the storage medium containing computer executable instructions provided in an embodiment of the present invention is not limited to the data association analysis method based on weighted improved Apriori as described in the above embodiment, and can also execute related operations in the data association analysis method based on weighted improved Apriori provided in any embodiment of the present invention.
[0146] So far, the technical solutions of the present invention have been described in conjunction with the preferred embodiments shown in the accompanying drawings. However, it is easy for those skilled in the art to understand that the protection scope of the present invention is obviously not limited to these specific embodiments. Without departing from the principle of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will fall within the protection scope of the present invention.
[0147] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A data association analysis method and system based on weight-improved Apriori, characterized in that: The following steps are involved: S1. Collect original railway accident data, filter and number the information on railway accident causes, accident types, and accident levels, and generate a multi-attribute railway accident dataset; S2. Calculate the weight of accident data based on entropy method; The S2 step includes the following steps: S21. Standardize the original railway accident data to eliminate the influence of different data indicator dimensions. The standardized calculation expression is: (1) In formula (1), X ij is the jth index value of the i-th accident level, X min and X max are the minimum and maximum values of the j-th indicator respectively; S22. Calculate the proportion matrix of each standardized indicator in each accident level. The calculation expression of the proportion matrix is: (2) In formula (2), Z ij is the normalized accident data value; S23, calculating the entropy value of each indicator, using the entropy value to reflect the amount of information of each indicator, the calculation expression of the entropy value of the indicator is: (3); In formula (3), , n is the number of samples; S24. Calculate the coefficient of difference of each indicator by using the entropy value. The calculation expression of the coefficient of difference is: (4) S25. Calculate the weight of each indicator according to the difference coefficient. The calculation expression of the weight of each indicator is: (5) In formula (5), m is the index number; S26, multiplying the standardized data by the corresponding indicator weight, and summing them to obtain the total weight of each accident level; S3. According to the weight of the accident data calculated based on the entropy method, the improved support and confidence indicators are set to mine the association rules in the railway accident data.
2. The data association analysis method based on weight-improved Apriori according to claim 1 is characterized in that: The S3 step includes the following steps: S31. According to the weights calculated by the entropy method and in combination with the goal of association analysis, set the minimum weighted support and minimum weighted confidence indicators; S32, scanning the multi-attribute railway accident data set, and generating a candidate item set C of k items from the multi-attribute railway accident data set k , k starts from 1, and the candidate item set C is calculated k The weighted support of each item set in , delete the item sets below the minimum weighted support threshold, and form a frequent item set L k ; The frequent item set L k Combine the elements in to generate a candidate item set C of k+1 items k+1 ; S33, repeat step S32 until the following conditions are met: the frequent item sets cannot be combined to generate a larger candidate item set, and / or the weighted support of all candidate item sets is lower than the specified minimum weighted support threshold. When the frequent item set cannot be generated, the weighted support calculation is terminated and step S34 is entered; S34, calculating the frequent item set L k The weighted confidence of each rule in is used to filter out strong association rules whose weighted confidence is not less than the minimum weighted confidence threshold.
3. The data association analysis method based on weight-improved Apriori according to claim 2, characterized in that: The calculation C of step S32 k The calculation expression of the weighted support of each item set in is: (6) In formula (6), W i is the weight of the i-th transaction; is the indicator function. When item set X and item set Y appear in transaction i at the same time, The value of is 1; when item set X and item set Y do not appear in transaction i at the same time, The value of is 0; is the sum of the weights of all transactions.
4. The data association analysis method based on weight-improved Apriori according to claim 2, characterized in that: The calculation expression for calculating the weighted confidence of each rule in the frequent item set in step S34 is: (7) In formula (7), (8) In formula (8), is the indicator function. When item set X appears in transaction i, The value of is 1, when item set X does not appear in transaction i, The value of is 0.
5. The data association analysis method based on weight-improved Apriori according to claim 1, characterized in that: The method of screening and numbering the information of the railway accident cause, accident type, and accident level in step S1 to generate a multi-attribute railway accident data set includes: With reference to domestic and foreign railway accident cause classification models, the causal factors in four aspects, namely personnel, equipment, environment and management, were identified and numbered to construct a multi-attribute railway accident dataset.
6. A data association analysis system based on weight-improved Apriori, executing the data association analysis method based on weight-improved Apriori as claimed in any one of claims 1 to 5, characterized in that: include: Railway accident data set construction and data preprocessing module: used to collect original railway accident data, screen and number the information on railway accident causes, accident types, and accident levels, and generate a multi-attribute railway accident data set; Weight calculation module based on entropy method: used to calculate the weight of accident data based on entropy method; Improved association rule mining algorithm module: used to set improved support and confidence indicators according to the weight of the accident data calculated based on the entropy method, and mine association rules in railway accident data; Wherein, the weight calculation module based on the entropy method includes: Standardization unit: used to standardize the original railway accident data and eliminate the impact of different data indicator dimensions; Calculation ratio matrix unit: used to calculate the ratio matrix of each standardized indicator in each accident level; Entropy value calculation unit: used to calculate the entropy value of each indicator, and use the entropy value to reflect the information amount of each indicator; A difference coefficient calculation unit is used to calculate the difference coefficient of each indicator through the entropy value; An indicator weight calculation unit: used to calculate the weight of each indicator according to the difference coefficient; Calculation unit for total accident level weight: used to multiply the standardized data by the corresponding indicator weight, and sum up to obtain the total weight of each accident level.
7. The data association analysis system based on weight-improved Apriori according to claim 6 is characterized in that: The improved association rule mining algorithm module includes: Setting minimum weighted support and confidence index unit: used to set the minimum weighted support and minimum weighted confidence index according to the weights calculated by the entropy method and the goal of association analysis; Generate frequent item set unit: used to scan the multi-attribute railway accident data set and generate k-item candidate item set C from the multi-attribute railway accident data set k , k starts from 1, and the candidate item set C is calculated k The weighted support of each item set in , delete the item sets below the minimum weighted support threshold, and form a frequent item set L k ; Weighted support calculation unit: used to repeatedly run step S32 until the following conditions are met: frequent item sets cannot be combined to generate a larger candidate item set, and / or the weighted support of all candidate item sets is lower than the specified minimum weighted support threshold. When frequent item sets cannot be generated, the weighted support calculation is terminated and step S34 is entered; Calculation weighted confidence unit: used to calculate the frequent item set L k The weighted confidence of each rule in is used to filter out strong association rules whose weighted confidence is not less than the minimum weighted confidence threshold.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the data association analysis method based on weight-improved Apriori according to any one of claims 1 to 5 are implemented.
9. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the data association analysis method based on weight-improved Apriori are implemented as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Multi-attribute railway accident cause weight analysis method
CN110532298A
Gas cylinder accident association rule mining method and system
CN118070239A
Mining association rules in the map-reduce framework
US20160092515A1
Cited By
Fire rescue resource distribution system based on big data
CN120297621A