# Cause Analysis of Coal Mine Gas Accidents in China Based on Association Rules
## 2 Methods
### Data Analysis Method
#### 2.3.2. Association Rule Method  
The factors in coal mine gas accident are discrete data, and the occurrence frequency and frequency of factors are not enough to obtain the potential information from them. In order to get the relationship between each factor, the association rule method was selected as a data mining method for analysis. (1) Association rule principle  
The association rule data mining method is a means to discover potential connections hidden in a large amount of data. These potential connections can reveal the relationship between data, which is more conducive to discovering the occurrence mechanism of events [26]. \(I\) for the item set, \(I=\left\{i_{1},\ i_{2},\ldots\ i_{n}\right\}\), where \(i_{n}\) called the item, each transaction \(T\) is a subset of item set \(I\). All \(T\) term sets, like \(X\)\(\rightarrow\)\(Y\) (\(X\),\(Y\subseteq I\), \(X\cap Y=\theta\)) is the implied expression of the association rule. A. Support:  
This refers to the probability that transaction \(X\) and transaction \(Y\) occur simultaneously in the item set. In the application of the association rule method, the most important thing is to select the support threshold. The support threshold needs to be set reasonably according to the data situation. If the calculated support is lower than the threshold, it indicates that the occurrence times of the item set \(\left\{X,\ Y\right\}\) in the total item set are too few. Otherwise, subsequent analysis can be carried out. Support is expressed as:  
\[Support\ (X\to Y)=P\ (X,Y)/P\ (I) \tag{1}\]  
B. Confidence:  
This refers to the probability of transaction \(Y\) occurring if transaction \(X\) has already occurred. More important is the choice of confidence threshold, which reflects the ability of the occurrence of transaction \(X\) to affect the occurrence of transaction \(Y\). Confidence is expressed as:  
\[Confidence\ (X\to Y)=P\ (Y|X)=P\ (X,Y)/P\ (X) \tag{2}\]  
C. Frequent item sets:  
The frequent item set refers to the set of all transactions whose support is greater than or equal to the support threshold. If the support of item set \(I\) meets the selected minimum support threshold, item set \(I\) is the frequent item set. D. Association rules:  
The association rules that meet the minimum support threshold and minimum confidence threshold are those selected to be mined. (2) Apriori algorithm  
Apriori algorithm is a data mining algorithm for mining frequent item sets and association rules. Its purpose is to carry out the two steps of association and mining continuously to find the association rules that meet the threshold of support and confidence. Firstly, by scanning the database, the count of each item is accumulated and the items that meet the minimum support threshold are collected to find the set of frequent item set 1, denoted as \(I_{1}\). Then, use \(I_{1}\) to find \(I_{2}\) of frequent item set 2, use \(I\) to find \(I_{3}\), and so on until frequent k item set can no longer be found. A full scan of the database is required for each \(I_{k}\) found. Analysis steps  
The frequent item set in this paper is a combination of frequently occurring factors that lead to coal mine gas accidents. The mining results of frequent item sets are closely related to the selection of support threshold. If the support threshold is set too large, there will be too few causes in frequent item sets, which is not conducive to the generation of association rule results. However, if the support threshold is set too small, the number of frequent item sets generated will be too large, and it is not easy to determine the root cause of coal mine gas accidents. In order to prevent improper selection of the support threshold from affecting the conclusion of association rules, this paper determines the most appropriate support degree by comparing frequent item sets obtained from different support degrees. Four support degrees of 0.2, 0.15, 0.1, and 0.05 were selected, and 0.05 was selected as the frequent item set of minimum support mining after comparison of results.