For Transaction ID 3, It contains beer only and beer does not exists in other transaction. Do I need to include transaction Id 3 when calculating the association rule by using the Apriori algorithm?
1 Answer
It really depends on what you'd like to get out of the association rules.
For example, how do you want to calculate the support of Milk -> Bread? Including TransactionID 3, it is 2/5, without, it is 2/4. Depending on your context, both could make sense.
If you are only keen on Beer being the sole consequent, then the antecedent of rule extracted would be (Milk = 0, Bread = 0, Butter = 0), with a confidence of 100%. Similarly, for Beer being the sole antecedent, we will have 3 rules:
- Beer = 1 -> Milk = 0 (100% confidence)
- Beer = 1 -> Bread= 0 (100% confidence)
- Beer = 1 -> Butter = 0 (100% confidence)
Would you find such rules useful in your context?