Data Warehousing and Data Mining Ā· Unit 6
Association Rule Mining
Exam-focused notes for Association Rule Mining (Data Warehousing and Data Mining, BIT454): what the TU syllabus asks and how it has actually been tested, with 2 solved past questions from this unit.
Association Rule Mining in short
Association rule mining finds items that often occur together in a data set. Shops use it to place products, plan offers and recommend items.
What this unit covers
- Market basket analysis concept
- Frequent itemset generation
- Apriori algorithm
- Strong association rules
- Support and confidence measures
- Laplace smoothing
Apriori algorithm
2081 Ā· 10 marks
Generate the frequent itemset from the following data using the Apriori algorithm and find the strong association rules. Minimum Support = 60%, Minimum Confidence = 75%.
| TID | Items |
|---|---|
| 1 | {A, C, D} |
| 2 | {B, C, D} |
| 3 | {A, B, C, D} |
| 4 | {B, D} |
| 5 | {A, B, C, D} |
[10]
Market basket analysis concept
2082.1 Ā· 10 marks
What is the concept behind market basket analysis?How do you generate frequent item sets using Apriori algorithm? Explain.[4+6]
Show solved answerHide answer
Market Basket Analysis and Apriori Algorithm
(a) Concept Behind Market Basket Analysis
Market Basket Analysis is a data mining technique used to discover associations and relationships between items purchased together by customers.
Key Concepts:
1. Purpose:
- Identifies which products are frequently bought together
- Discovers customer purchasing patterns and behavior
- Helps in product placement, cross-selling, and promotional strategies
2. Core Idea:
- Analyzes transaction data to find item combinations
- Determines how often certain items co-occur in transactions
- Establishes rules like "if customer buys X, they likely buy Y"
3. Business Applications:
- Supermarket shelf arrangement (placing related items near each other)
- Recommendation systems (suggesting complementary products)
- Bundle pricing and promotional campaigns
- Inventory management and stock optimization
4. Association Rules:
- Expressed as: If {Item A} then {Item B}
- Measured using metrics like support, confidence, and lift
- Helps predict customer behavior and increase sales
(b) Generating Frequent Itemsets Using Apriori Algorithm
Algorithm Overview:
The Apriori Algorithm generates frequent itemsets by iteratively finding itemsets that appear in at least a minimum support threshold of transactions.
Key Principle:
"If an itemset is frequent, then all of its subsets must also be frequent" (Apriori property)
Steps:
Step 1: Set Minimum Support Threshold
- Define minimum support (e.g., 50% or 2 transactions out of 4)
- Only itemsets meeting this threshold are considered frequent
Step 2: Generate 1-Itemsets (Lā)
- Count occurrences of each individual item
- Keep items with support ā„ minimum support
- Example: {A}, {B}, {C}, {D}
Step 3: Generate Candidate k-Itemsets (Cā)
- Join frequent (k-1)-itemsets to create candidate k-itemsets
- Apply pruning: remove candidates containing infrequent subsets
- Example: From {A}, {B}, {C} ā candidates {A,B}, {A,C}, {B,C}
Step 4: Count Support for Candidates
- Scan database to count occurrences of each candidate itemset
- Calculate support = (frequency of itemset) / (total transactions)
Step 5: Filter by Minimum Support
- Keep only candidates with support ā„ threshold
- These become frequent k-itemsets (Lā)
Step 6: Repeat Until No New Itemsets
- Continue with k+1 until no new frequent itemsets are generated
Example:
| Transaction | Items |
|---|---|
| T1 | {A, B, C} |
| T2 | {A, B} |
| T3 | {A, C} |
| T4 | {B, C} |
With minimum support = 50% (2 transactions):
- Lā: {A}(3), {B}(3), {C}(3) - all frequent
- Cā: {A,B}, {A,C}, {B,C}
- Lā: {A,B}(2), {A,C}(2), {B,C}(2) - all frequent
- Cā: {A,B,C}
- Lā: {A,B,C}(1) - NOT frequent (support < 50%)
Result: Frequent itemsets are {A}, {B}, {C}, {A,B}, {A,C}, {B,C}
Advantages:
- Efficient pruning reduces search space
- Guarantees finding all frequent itemsets
- Widely used in practice
Make Unit 6 stick
Practice BIT454 with flashcards & quizzes