<aside> <img src="/icons/table_red.svg" alt="/icons/table_red.svg" width="40px" /> Table of Contents
</aside>
<aside> 💡
<aside> 💡
Association Rule Learning: A Comprehensive Explanation
Market Basket Analysis
Components of Association Rule Learning
Measures how frequently an itemset occurs in the dataset.
It is a probability that a transaction contains {X U Y}.
i.e. It is the percentage of transaction in which item X and Y occurred together.
Formula:
$$ \text{Support (S)} = \frac{\text{Number of transactions containing X ∪ Y}}{\text{Total number of transactions}} $$
Example: For a rule {Milk, Bread} → Butter, Support indicates the percentage of transactions where Milk, Bread, and Butter were bought together.
Measures the likelihood of Consequent being purchased when the Antecedent is purchased.
Or we can say It is a conditional probability that transaction having X also contains Y.
i.e. It is the probability that if the L.H.S. appears in a transaction then also the R.H.S. will.
Formula:
$$ \text{Confidence (C)} = \frac{\text{Number of transactions containing X ∪ Y}}{\text{Number of transactions containing X}} $$
Example: For the rule {Milk, Bread} → Butter, Confidence tells us the percentage of transactions with Milk and Bread that also include Butter.
Measures the strength of a rule by comparing its Confidence to the overall probability of the Consequent.
Formula:
$$ \text{Lift (L)} = \frac{\text{Confidence (X → Y)}}{\text{Support (Y)}} $$
Lift > 1: Rule is stronger than random chance.
Lift = 1: Rule is independent.
Lift < 1: Rule is weaker than random chance.
Apriori Algorithm Overview