Question:
Suppose we have a transaction dataset from a supermarket, and the following information is available:
40%
of all transactions involve the purchase of apples.
60%
of all transactions involve the purchase of oranges.
30%
of the transactions that purchase apples also purchase oranges.
Based
on this information, deduce the non-trivial association rules along with their
support and
confidence
values.
Answer:
Given Information:
Support(apples)=0.40
Support(oranges)=0.60
Confidence(apples →oranges)=0.30
Now we have to calculate support(apples, oranges):
The confidence of the rule is given as 0.30.
Confidence(apples →oranges) = Support(apples ∧ oranges) / Support(apples)
0.3 = Support(apples, oranges) / 0.40
Then, Support(apples, oranges) = 0.30×0.40 = 0.12
Non-Trivial Association Rules:
Rule 1: apples →oranges
Rule 2:
Calculate Confidence for :
We already know
Confidence of (Oranges, apples) defined as: confidence(oranges, apples) = support(apples, oranges) / support(oranges)
Confidence(oranges →apples)=0.12/ 0.60 =0.20
Summarize the Association Rules with Support and Confidence:
Rule 1: