Question:
Suppose out of 100 transactions, 40 transactions have
purchased both tea and coffee. Only tea but no coffee has been purchased in 20
transactions, whereas only coffee but no tea has been purchased in 10
transactions. What is the lift of the rule: tea → coffee?
Answer:
To find the lift of the rule tea → coffee, we need to follow these steps:
Calculate the support of tea ():
- 40 transactions have both tea and coffee.
- 20 transactions have only tea but no coffee.
- So, total transactions with tea = 40 (tea and coffee) + 20 (only tea) = 60 transactions.
Calculate the support of coffee ():
- 40 transactions have both tea and coffee.
- 10 transactions have only coffee but no tea.
- So, total transactions with coffee = 40 (tea and coffee) + 10 (only coffee) = 50 transactions.
Calculate the support of the rule ():
- This is the support of transactions having both tea and coffee.
- Calculate the confidence of the rule ():
Confidence(tea →coffee)=Support(tea ∧coffee) / Support(tea) = 0.40/0.60 =2/3 ≈0.667
- Calculate the lift of the rule ():
Lift(tea →coffee)=Confidence(tea →coffee) /Support(coffee) =0.667 / 0.50 =1.52≈1.333