Market basket analysis
Bred -> Milk [Support = 15%, confidence = 70%]
The rule says that 15% customers buy Bred and Milk together,
and those who buy Bred also buy Beer 70% of time. The basket is considered as a transaction, which contains items. So transaction is a set of items.
For example, at a supermarket you put in the basket 1 loaf of bred and 1 carton of milk.
Transaction = {Bred, Milk}
The Support of a rule, {Bred} -> {Milk}, is
Transaction = {Bred, Milk}
Support = countTr({Bred} + {Milk}) / N
where N is a number of transactions, countTr(Itemset) is a function that counts transations that contains Itemset.The Confidence of a rule is
Confidence = countTr({Bred} + {Milk}) / countTr({Bred})
To prevent discovering all association rules we can use user-specified minsup and minconf.
Links
- Wikipedia, Affinity analysis
- Bing Lui, 2006, Web data mining
May 21th, 2011