Mining frequent itemsets with Eclat
In addition to the Apriori algorithm, you can use the Eclat algorithm to generate frequent itemsets. As the Apriori algorithm performs a breadth-first search to scan the complete database, the support counting is rather time consuming. Alternatively, if the database fits into the memory, you can use the Eclat algorithm, which performs a depth-first search to count the supports. The Eclat algorithm, therefore, performs quicker than the Apriori algorithm. In this recipe, we will introduce how to use the Eclat algorithm to generate frequent itemsets.
Getting ready
In this recipe, we will continue using the Groceries
dataset as our input data source.
How to do it...
Perform the following steps to generate a frequent itemset using the Eclat algorithm:
- Similar to the Apriori method, we can use the
eclat
function to generate the frequent itemset:
> frequentsets=eclat(Groceries,parameter=list(support=0.05, maxlen=10))
- We can then obtain the...