ESE Handouts 4 - FP Growth Algorithm (Fall 2016)
ESE Handouts 4 - FP Growth Algorithm (Fall 2016)
FP Growth Algorithm
1
ASSOCIATION RULE MINING
FP Growth Algorithm
2
ASSOCIATION RULE MINING
• Construct an FP-tree
– Create a root node labeled null
– Scan database
• Process the items in each transaction in L order
• From the root, add nodes in the order in which items
appear in the transactions
• Link nodes representing items along different
branches
3
ASSOCIATION RULE MINING
TID Items
1 I1,I2,I5 • Minimum support of ~20% (count of 2)
2 I2,I4 • Frequent 1-itemsets
3 I2,I3,I6 I1, I2, I3, I4, I5
4 I1,I2,I4 • Construct list
5 I1,I3
L = {(I2,7),(I1,6),(I3,6),(I4,2),(I5,2)}
6 I2,I3
7 I1,I3
8 I1,I2,I3,I5
9 I1,I2,I3
4
ASSOCIATION RULE MINING
TID Items
I2 2 null
1 I1,I2,I5
I1 1
2 I2,I4
I3 0 (I2,2)
3 I2,I3,I6
I4 1
(I4,1) 4 I1,I2,I4
I5 1 (I1,1)
5 I1,I3
(I5,1) 6 I2,I3
7 I1,I3
8 I1,I2,I3,I5
9 I1,I2,I3
6
ASSOCIATION RULE MINING
8
ASSOCIATION RULE MINING
Header Table {}
Conditional pattern bases
Item frequency head f:4 c:1 item cond. pattern base
f 4
c 4 c f:3
c:3 b:1 b:1
a 3 a fc:3
b 3 a:3 p:1
m 3 b fca:1, f:1, c:1
p 3 m:2 b:1 m fca:2, fcab:1
p fcam:2, cb:1
p:2 m:1
9
ASSOCIATION RULE MINING
10
ASSOCIATION RULE MINING
m-conditional FP-tree
11
ASSOCIATION RULE MINING
12
ASSOCIATION RULE MINING
Reference
13