Lesson 8.5: Association Rule Learning – Apriori, Market Basket Analysis
🔹 What is Association Rule Learning?
Association Rule Learning is an unsupervised learning technique used to discover interesting relationships (rules) between variables in large datasets.
-
Commonly used in market basket analysis to find products that are frequently bought together.
🔹 Key Concepts
-
Support: How often an itemset appears in the dataset.
Support(A→B)=Transactions with A and BTotal TransactionsSupport(A \rightarrow B) = \frac{Transactions~with~A~and~B}{Total~Transactions}
-
Confidence: Likelihood that B is purchased when A is purchased.
Confidence(A→B)=Support(A∩B)Support(A)Confidence(A \rightarrow B) = \frac{Support(A \cap B)}{Support(A)}
-
Lift: Measures strength of a rule over random chance.
Lift(A→B)=Confidence(A→B)Support(B)Lift(A \rightarrow B) = \frac{Confidence(A \rightarrow B)}{Support(B)}
🔹 Apriori Algorithm
-
Finds frequent itemsets in the dataset.
-
Generates rules based on minimum support and confidence thresholds.
Example:
-
min_support→ Minimum frequency to consider -
min_threshold→ Minimum confidence for rules
🔹 Market Basket Analysis
-
Retail example: “Customers who buy bread often buy butter.”
-
Helps in cross-selling, promotions, and store layout optimization.
🔹 Advantages
-
Identifies hidden patterns in large datasets.
-
Useful for business decision-making.
🔹 Disadvantages
-
Can generate too many rules → Needs filtering.
-
Requires large datasets to be meaningful.
✅ Quick Recap:
-
Association Rule Learning → Discover frequent item combinations.
-
Apriori → Algorithm to find rules.
-
Market Basket Analysis → Practical business application.
