Apply the Apriori algorithm to generate frequent itemsets and
association rules. Show your calculations for each step clearly.
Consider the following transaction dataset:
Transaction ID Items Purchased
T1 Milk, Bread, Butter
T2 Bread, Butter, Eggs
T3 Milk, Bread, Butter, Eggs
T4 Milk, Bread
T5 Milk, Eggs
1. Generate Frequent Itemsets:
o Use the Apriori algorithm with a minimum support count of 2.
o List all frequent 1-itemsets, 2-itemsets, and 3-itemsets.
2. Generate Association Rules:
o Using the frequent itemsets generated above, generate all association
rules with a minimum confidence of 60%.
o For each rule, calculate the support, confidence, and lift.
3. Answer the following questions:
o Which item is most frequently purchased?
o Are there any strong associations (confidence > 80%) between items? If
yes, describe them.