Association Rule Mining-Hands - On
Association Rule Mining-Hands - On
You have a list of sales transactions that happened over the last 1 hour
The goal is to determine patterns in the items purchased
You want to develop an association rule among the items ... How will you do that ?
Approach
To reach the end goal , the first step taken is to determine the support for a given set of items.
For Example , you see Bread and Butter in 60% of the transactions. Is that considered frequent
? What if the frequency was 20% or 80 % ?
Support - Explained
Support is the number of times you see an item or items over a list of all the transactions.
Representing Support
support(A->B) = P(AUB)
Support - Elaborated
The support of A -> B is the percentage of transactions that contain both A and B.
Support of A -> B = Number of Transactions that have both A and B / Total Number of
Transactions
Confidence - Explained
confidence(A->B) = P(B|A)
We can read this as the confidence of item A leading to item B is the probability of B given A.
Association Rule
Getting the support and confidence are the pre-requisites for Association Rule.
After getting the metrics , we can form the Association Rule.
Interpreting the above rule , 10% of the carts or baskets have vanilla wafers , banana and whipped
cream together.
80% of the customers who brought vanilla wafers also purchased bananas and whipped cream
There is not much value in calculating the support of any itemset if the all
the itemsets are not frequent
This property will help us find frequent item sets faster