Association rule algorithms
Without an association rule algorithm, you are left with the computationally very expensive task of generating all possible pairs of itemsets, and then trying to mine the data in order to identify the best ones yourself. Associate rule algorithms help with filtering this.
The most popular algorithm for MBA is the apriori algorithm, which is contained within the arules
package (the other popular algorithm is the eclat algorithm).
Running apriori is fairly simple. We will demonstrate this using our demo 10 transaction itemset that we just printed.
The apriori algorithm is based upon the principle that if a particular itemset is frequent, then all of its subsets must also be frequent. That principle itself is helpful for reducing the number of itemsets that need to be evaluated, since it only needs to look at the largest items sets first, and then be able to filter down:
- First, some housekeeping. Fix the number of printable digits to 2:
options(digits = 2)
- Next...