2081 2

CSC420 · 2081 · 10 marks

How do you generate strong association rules? From the following dataset find the frequent item set using FP growth algorithm using 3 as minimum support. | Transaction ID | Items | |---|---| | T1 | {K, E, M, O, Y} | | T2 | {K, E, O, Y} | | T3 | {K, E, M} | | T4 | {K, M, Y} | | T5 | {K, E, O} |

How do you generate strong association rules? From the following dataset find the frequent item set using FP growth algorithm using 3 as minimum support.

Transaction IDItems
T1{K, E, M, O, Y}
T2{K, E, O, Y}
T3{K, E, M}
T4{K, M, Y}
T5{K, E, O}

[10]

Data Warehousing and Data MiningChapter 5: Mining Frequent PatternsFinding frequent itemsetNumerical: FP growth algorithm

Strong Association Rules and FP-Growth

Given Data

Transactions:

  • T1: {K, E, M, O, Y}
  • T2: {K, E, O, Y}
  • T3: {K, E, M}
  • T4: {K, M, Y}
  • T5: {K, E, O}

Minimum support = 3

Part 1: Generating Strong Association Rules

A strong association rule $X \Rightarrow Y$ satisfies both thresholds:

  • $\text{support}(X \cup Y) \geq \text{min_support}$
  • $\text{confidence}(X \Rightarrow Y) = \dfrac{\text{support}(X \cup Y)}{\text{support}(X)} \geq \text{min_confidence}$

Procedure:

  1. Find all frequent itemsets satisfying min support (via Apriori or FP-Growth).
  2. For each frequent itemset $l$, generate every non-empty proper subset $s$.
  3. For each such $s$, form the rule $s \Rightarrow (l - s)$ and compute confidence $= \dfrac{\text{support}(l)}{\text{support}(s)}$.
  4. Output the rule only if confidence $\geq$ min_confidence. These are the strong rules.

Part 2: FP-Growth (min_support = 3)

Step 1: Item frequency (1st scan)

ItemCount
K5
E4
M3
O3
Y3

All satisfy min support. Order (descending, ties alphabetical): K:5, E:4, M:3, O:3, Y:3

Step 2: Reordered transactions

TIDOrdered
T1K, E, M, O, Y
T2K, E, O, Y
T3K, E, M
T4K, M, Y
T5K, E, O

Step 3: FP-Tree

null
 └── K:5
      ├── E:4
      │    ├── M:1
      │    │    └── O:1
      │    │         └── Y:1
      │    └── O:2
      │         └── Y:1
      └── M:2
           └── Y:1

Note on M placement:

  • T1 (KEMOY) and T3 (KEM) go under E-branch: E→M appears twice (M:2 under E).
  • T4 (KMY) goes under K directly: K→M (M:1 under K, no E).

So M under E has count 2, and M under K (no E) has count 1. Total M = 3. ✓

Corrected FP-Tree:

null
 └── K:5
      ├── E:4
      │    ├── M:2   (from T1, T3)
      │    │    └── O:1   (T1)
      │    │         └── Y:1
      │    └── O:2   (T2, T5)
      │         └── Y:1   (T2)
      └── M:1   (T4)
           └── Y:1

Take care with the M counts: the correct placement is M:2 under E and M:1 under K, not the other way round.

Header table:

ItemSupportNode links
K5K:5
E4E:4
M3M:2, M:1
O3O:1, O:2
Y3Y:1, Y:1, Y:1

Step 4: Mining (bottom-up)

Item Y (support 3): Conditional pattern base:

  • {K,E,M,O}:1 (T1)
  • {K,E,O}:1 (T2)
  • {K,M}:1 (T4)

Counts: K=3, E=2, M=2, O=2. Only K:3 ≥ 3. Frequent: {K,Y}:3

Item O (support 3): Conditional pattern base:

  • {K,E,M}:1 (T1)
  • {K,E}:2 (T2, T5)

Counts: K=3, E=3, M=1. Survive: K:3, E:3. Conditional FP-tree: K→E (3). Frequent: {K,O}:3, {E,O}:3, {K,E,O}:3

Item M (support 3): Conditional pattern base:

  • {K,E}:2 (T1, T3)
  • {K}:1 (T4)

Counts: K=3, E=2. Only K:3 survives. Frequent: {K,M}:3

Item E (support 4): Conditional pattern base:

  • {K}:4

Frequent: {K,E}:4

Item K: root, no conditional patterns.

Final Frequent Itemsets (support ≥ 3)

1-itemsets:

  • {K}:5, {E}:4, {M}:3, {O}:3, {Y}:3

2-itemsets:

  • {K,E}:4
  • {K,M}:3
  • {K,O}:3
  • {E,O}:3
  • {K,Y}:3

3-itemsets:

  • {K,E,O}:3

The maximal/most useful frequent itemset is {K, E, O} with support 3.

Short on time? The 1, 5 and 10 mark versions of this answer, flashcards and practice sets come with a program pass.