Mining frequent itemsets with Eclat
As the Apriori algorithm performs a breadth-first search to scan the complete database, support counting is rather time-consuming. Alternatively, if the database fits into memory, one can use the Eclat algorithm, which performs a depth-first search to count supports. The Eclat algorithm, therefore, runs much more quickly than the Apriori algorithm. In this recipe, we introduce how to use the Eclat algorithm to generate a frequent itemset.
Getting ready
In this recipe, one has to have completed the previous recipe by generating rules and have these stored in a variable named rules
.
How to do it…
Please 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 a frequent itemset:> frequentsets=eclat(trans,parameter=list(support=0.01,maxlen=10))
- We can then obtain the summary information from the generated frequent itemset:
> summary(frequentsets)...