Mining Frequent Patterns with Apriori Algorithm
- Run Scan and Generate 1-frequent itemset and their support count
- Accumulate the generated frequent itemsets to my global variable that holds on to all my frequent itemsets
- Sort the items in all my itemsets according to their term index
- Run Join to the frequent itemset to generate my candidate itemsets
- Run Scan on the candidate itemsets to generate another set of frequent items
- If I have more than one 1 candidate itemset perform process 2-5 again
Closed patterns: I perform a top down approach. Therefore, I find my closed patterns from my frequent patterns. For each item set in all my frequent patterns, I retrieve the parents of the selected item set and if all its parents’ support is not equal to the item sets’ support and the item sets’ support is greater than the min_sup, then the item set is added as a closed pattern.
Maximal patterns: After finding all the closed patterns, in order to find the maximal patterns, I check if a closed pattern has parents’, if it doesn’t then the closed pattern is added as a maximal pattern.