# Method for Mid-Long-Term Prediction of Landslides Movements Based on Optimized Apriori Algorithm
## 2 Method  
### IAprioriMR  
Apriori is one of the commonest association rule algorithms, and several methods have been derived using the Apriori algorithm [20]. The Apriori algorithm refers to a loop method that uses hierarchical sequential search, also termed as an iterative method of layer-by-layer search to generate frequent item-sets. However, a single host cannot handle a large number of operations. Processing considerable data is now becoming a new trend. Recently, many algorithms have been proposed, which apply the Apriori in the MapReduce computing framework [21]. This pattern is based on MapReduce, which is hereinafter referred to as AprioriMR. AprioriMR produces all candidate items one time in the Map task, and the form of each candidate itemset is a product with \(<\)\(k\), \(v\)\(>\) form. Subsequently, according to the differences of Key, the candidate items are classified and counted by Reduce with the minimum support to screen the high frequency candidate item-sets [22]. The optimized conventional Apriori algorithm can fit the MapReduce framework for distributed parallel computing. However, because it produces all candidate item-sets one time in the Map task, there will be a large memory footprint, significantly decreasing the operating efficiency [23]. Thus, the counting in the Map stage will be time-consuming, and valuable association rules are difficult to find. The Apriori algorithm imposes a heavy burden to MapReduce [24]. In general, the association rules are expressed as X=\(>\)Y. The definition is as follows: in the presence of X, Y, the large-scale item-sets are defined. \(I=\{i_{1},\,i_{2},\,\ldots,\,i_{n}\}\) is a set of items, and a pattern \(P\) is defined as \(\{P=\{i_{j},\,\ldots,\,i_{k}\}\subseteq I,j\geq 1,\,k\leq n\}\). Given a pattern \(P\), its length or size is expressed as \(|P|\), i.e., the number of the singletons it covers. Thus, for \(P=\{i_{1},\,i_{2},\,\ldots,\,i_{k}\}\subseteq I\), its size is defined as \(|P|=k\). Besides, given a set of all transactions \(T=\{t_{1},\,t_{2},\,\ldots,\,t_{m}\}\) in a dataset, the support of a pattern \(P\) is defined as the number of transactions that \(P\) satisfies, i.e., support(\(P\)) = \(|\{Vt_{1}\in T;P\subseteq t_{i}\}|\). A pattern \(P\) is considered frequent if \(support(P)\geq threshold\)[22], in this paper, the threshold of minimum support is \(1\%\). Thus, for each pair \((P_{l},\{supp(P)_{1},\,supp(P)_{2},\,\ldots,\,supp(P)_{m|l})\}\), the result is a \(\{P,\,supp(P)\}\)pair, so \(supp(P)\)\(=\sum_{l=1}^{m}supp\) (p)\(l\). This method, when dealing with big data, due to the large scale of the transaction, will yield a huge candidate set. This study aimed to enhance the computational efficiency of a novel algorithm (hereinafter referred to as IAprioriMR). It does not yield the whole set of candidate item-sets \(C\) for each transaction \(t_{l}\in T\), whereas the subset \(c\subseteq C\) consists of patterns of size \(|P|=s\). Hence, a set of iterations are required, one per different item-set-size (see Algorithm 1). Subsequently, the dataset is split into different chunks of data, one per mapper, and each mapper is responsible for analyzing each single transaction \(t_{l}\in T\) to generate \(P\), \(support(P)_{l}\) pairs. Lastly, this algorithm also covers multiple reducers to scale down the computational cost. The major difference between AprioriMR and IAprioriMR lies in the mapper, since IAprioriMR obtains any pattern \(P\) of size \(|P|=s\) for each sub-database (see Figure 1). Thus, the number of \(P,\,support(P)_{l}\) pairs generated by each mapper is lower than that by the AprioriMR algorithm [22].