CSC420 ยท 2076 ยท 10 marks
List the problems of Apriori algorithm with its possible solutions. Consider the following transaction dataset. What association rules can be found in this set, if the minimum support is 3 and the minimum confidence is 80%? | Transaction_ID | Item_List | |---|---| | T1 | {K, A, D, B} | | T2 | {D, A,
List the problems of Apriori algorithm with its possible solutions. Consider the following transaction dataset. What association rules can be found in this set, if the minimum support is 3 and the minimum confidence is 80%?
| Transaction_ID | Item_List |
|---|---|
| T1 | {K, A, D, B} |
| T2 | {D, A, C, E, B} |
| T3 | {C, A, B, E} |
| T4 | {B, A, D} |
[10]
Apriori Algorithm: Problems, Solutions, and Association Rule Mining
Part 1: Problems of Apriori and Solutions
Problems
- Huge number of candidate itemsets. At each level Apriori generates many candidates. For example, $10^4$ frequent 1-itemsets produce roughly $\binom{10^4}{2}\approx 5\times10^7$ candidate 2-itemsets.
- Multiple database scans. The full database must be scanned once for every level $k$, causing heavy I/O cost.
- Costly pattern matching / support counting. Each candidate must be checked against every transaction.
- High memory usage. Storing all candidates at each iteration is infeasible for large data.
Possible Solutions
| Problem | Solution |
|---|---|
| Too many candidates | Hash-based technique to bucket and prune candidate k-itemsets |
| Repeated scans | FP-Growth (only 2 scans, no candidate generation) |
| Large candidate sets | Transaction reduction (drop transactions with no frequent itemsets) |
| Memory bottleneck | Partitioning the database to fit in memory |
| Full-database cost | Sampling a representative subset, then verify |
| Support counting cost | Dynamic Itemset Counting (DIC) to reduce passes |
Part 2: Association Rule Mining
Given data
- Transactions: T1{K,A,D,B}, T2{D,A,C,E,B}, T3{C,A,B,E}, T4{B,A,D}
- Minimum support count = 3
- Minimum confidence = 80%
- Total transactions = 4
Step 1: L1 (1-itemsets)
| Item | Count | Frequent (>=3)? |
|---|---|---|
| K | 1 | No |
| A | 4 | Yes |
| D | 3 | Yes |
| B | 4 | Yes |
| C | 2 | No |
| E | 2 | No |
$L_1 = { {A}, {D}, {B} }$
Step 2: L2
Candidates: {A,D}, {A,B}, {D,B}
| Itemset | Transactions containing | Count | Frequent? |
|---|---|---|---|
| {A,D} | T1,T2,T4 | 3 | Yes |
| {A,B} | T1,T2,T3,T4 | 4 | Yes |
| {D,B} | T1,T2,T4 | 3 | Yes |
$L_2 = { {A,D}, {A,B}, {D,B} }$
Step 3: L3
Candidate {A,D,B}. All subsets ({A,D},{A,B},{D,B}) are frequent, so retain.
| Itemset | Transactions | Count | Frequent? |
|---|---|---|---|
| {A,D,B} | T1,T2,T4 | 3 | Yes |
$L_3 = { {A,D,B} }$
No 4-itemsets possible. Terminate.
Step 4: Association Rules
$$\text{Conf}(X\Rightarrow Y)=\frac{\text{Sup}(X\cup Y)}{\text{Sup}(X)}$$
Support values: A=4, D=3, B=4, {A,D}=3, {A,B}=4, {D,B}=3, {A,D,B}=3.
From {A,D} (sup 3):
| Rule | Confidence | >=80%? |
|---|---|---|
| A โ D | 3/4 = 75% | No |
| D โ A | 3/3 = 100% | Yes |
From {A,B} (sup 4):
| Rule | Confidence | >=80%? |
|---|---|---|
| A โ B | 4/4 = 100% | Yes |
| B โ A | 4/4 = 100% | Yes |
From {D,B} (sup 3):
| Rule | Confidence | >=80%? |
|---|---|---|
| D โ B | 3/3 = 100% | Yes |
| B โ D | 3/4 = 75% | No |
From {A,D,B} (sup 3):
| Rule | Confidence | >=80%? |
|---|---|---|
| A โ D,B | 3/4 = 75% | No |
| D โ A,B | 3/3 = 100% | Yes |
| B โ A,D | 3/4 = 75% | No |
| A,D โ B | 3/3 = 100% | Yes |
| A,B โ D | 3/4 = 75% | No |
| D,B โ A | 3/3 = 100% | Yes |
Final Strong Association Rules (support >= 3, confidence >= 80%)
- $D \Rightarrow A$ (100%)
- $A \Rightarrow B$ (100%)
- $B \Rightarrow A$ (100%)
- $D \Rightarrow B$ (100%)
- $D \Rightarrow A,B$ (100%)
- $A,D \Rightarrow B$ (100%)
- $D,B \Rightarrow A$ (100%)
Short on time? The 1, 5 and 10 mark versions of this answer, flashcards and practice sets come with a program pass.