# A Pattern Mining Method for Teaching Practices
## 2 Materials and Methods
### Pattern Mining
The first step is to analyze data utilizing association rule mining to identify frequent associations across all data in the graph database. In this work, the Apriori algorithm is used, although it should be noted that the algorithm can be computationally expensive, and improvements are possible depending on the application context. In this article, for the sake of simplicity and small amount of data, the simple variant is presented. In step 2, the results from association rule mining are used to design hypotheses to draw initial conclusions about possible patterns. In the third step, the results are manually checked for plausibility with further material such as lesson plans or evaluation data (e.g. surveys, interviews) and conclusions are drawn. This forms the basis for describing a pattern based on a structure (problem, context, solution). The Apriori algorithm for association rule mining was initially presented in [47] for the prediction of shopping patterns of customers (as known for \"you may also like to buy\") and was already applied for pattern research in the field of digital humanities [12]. The idea of the Apriori algorithm approach is to first discover frequent occurring items (support) from a dataset and then identify the likeliness of the occurence of a one itemset, if another itemset is already present (confidence). For example, in the area of teaching, the frequencies of combined use of different digital tools could first be identified and then evaluated in terms of their occurrence with the evaluation data, which may indicate possible patterns depending on support and confidence. Support and confidence are defined as follows [12; 48]: Let \(P:=P_{1},P_{2},\ldots P_{n}\) be the set of all available parameters to a teaching sequence and \(P_{1}:=b_{1},b_{2},...b_{k}\) for example be a set of digital tools, and \(P_{2}:=s_{1},s_{2},...s_{n}\) be a set of evaluation data and so on. Then the transaction of a lesson sequence is given by \(T_{LS}:=T_{1}\cup T_{2}\ldots\cup T_{n}\) such that \(T_{1}\subseteq P_{1},T_{2}\subseteq P_{2}...T_{n}\subseteq P_{n}\). Then an association rule \(X\to Y\) is consisted of an antecedent \(X\) (a set of items with \(P_{X}\subset P\)) and a consequent \(Y\) (a set of items with \(P_{Y}\subset P\)) and for the selection of association rules, there are the following metrics:  
\[s=support(X\to Y)=\frac{|t\;\in\;T|(X\cup Y)\subseteq t|}{|T|}. \tag{1}\]  
Then s describes the frequency of the association-rule \(X\to Y\) in the set of transactions. A high value means that the rule describes a large part of the dataset. \[c=confidence(X\to Y)=\frac{support(X\to Y)}{support(X)}. \tag{2}\]  
Then, c describes the proportion of transactions with X that also contain Y and determine the estimate of a conditional probability. In the search for association rules, lower bounds are defined for a minimum support and a minimum confidence that must be met. The approach to identify frequent association rules then form two steps, where first the sets of items that meet a certain minimum support are determined and then association rules are searched for in this set based on the minimum confidence. Following the proposed four-step pattern mining approach described above, the next step (2) is to hypothesize about the Apriori algorithm's results with high support and confidence factors and how it might be interpreted. To support these hypotheses, the instructional data collected in the graph database is then qualitatively considered again to derive more insights from the results (3). If the assumptions from the Apriori algorithm and the qualitative verification are confirmed, a pattern is described (4). In the next section, this process is demonstrated through an example.