100% found this document useful (1 vote)
496 views

FP Tree Growth: Frequent Pattern Growth Algorithm

1. The FP Growth algorithm constructs an FP tree to represent frequent patterns in a database without candidate generation. 2. The FP tree maintains the association between frequent itemsets by linking nodes together based on transactions. 3. The algorithm mines frequent patterns by traversing the FP tree from the lowest nodes and generating conditional pattern bases and conditional FP trees.

Uploaded by

Genghis Khan 69
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
496 views

FP Tree Growth: Frequent Pattern Growth Algorithm

1. The FP Growth algorithm constructs an FP tree to represent frequent patterns in a database without candidate generation. 2. The FP tree maintains the association between frequent itemsets by linking nodes together based on transactions. 3. The algorithm mines frequent patterns by traversing the FP tree from the lowest nodes and generating conditional pattern bases and conditional FP trees.

Uploaded by

Genghis Khan 69
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

FP Tree Growth

Frequent Pattern Growth Algorithm


This algorithm is an improvement to the Apriori method. A frequent pattern is generated without the need for
candidate generation. FP growth algorithm represents the database in the form of a tree called a frequent pattern
tree or FP tree.
This tree structure will maintain the association between the item sets. The database is fragmented using one
frequent item. This fragmented part is called “pattern fragment”. The item sets of these fragmented patterns are
analyzed. Thus with this method, the search for frequent item sets is reduced comparatively.

FP Tree
Frequent Pattern Tree is a tree-like structure that is made with the initial item sets of the database. The purpose
of the FP tree is to mine the most frequent pattern. Each node of the FP tree represents an item of the itemset.
The root node represents null while the lower nodes represent the item sets. The association of the nodes with the
lower nodes that is the item sets with the other item sets are maintained while forming the tree.

Frequent Pattern Algorithm Steps


The frequent pattern growth method lets us find the frequent pattern without candidate generation.
Let us see the steps followed to mine the frequent pattern using frequent pattern growth algorithm:
1. The first step is to scan the database to find the occurrences of the item sets in the database. This step
is the same as the first step of Apriori. The count of 1-itemsets in the database is called support count
or frequency of 1-itemset.
2. The second step is to construct the FP tree. For this, create the root of the tree. The root is represented
by null.
3. The next step is to scan the database again and examine the transactions. Examine the first transaction
and find out the itemset in it. The itemset with the max count is taken at the top, the next itemset with
lower count and so on. It means that the branch of the tree is constructed with transaction item sets in
descending order of count.
4. The next transaction in the database is examined. The item sets are ordered in descending order of
count. If any itemset of this transaction is already present in another branch (for example in the 1st
transaction), then this transaction branch would share a common prefix to the root.
This means that the common itemset is linked to the new node of another itemset in this transaction.
5. Also, the count of the itemset is incremented as it occurs in the transactions. Both the common node
and new node count is increased by 1 as they are created and linked according to transactions.
6. The next step is to mine the created FP Tree. For this, the lowest node is examined first along with the
links of the lowest nodes. The lowest node represents the frequency pattern length 1. From this,
traverse the path in the FP Tree. This path or paths are called a conditional pattern base.
Conditional pattern base is a sub-database consisting of prefix paths in the FP tree occurring with the lowest node
(suffix).
7. Construct a Conditional FP Tree, which is formed by a count of item sets in the path. The item sets
meeting the threshold support are considered in the Conditional FP Tree.
8. Frequent Patterns are generated from the Conditional FP Tree.

Example: Create Association Rules by using FP-Growth algorithm with minimum support
count = 3.

Transaction List of items

T1 I1,I2,I3
T2 I2,I3,I4
T3 I4,I5
T4 I1,I2,I4
T5 I1,I2,I3,I5
T6 I1,I2,I3,I4
Solution:
Step No 1: Count of each item

Item Count

I1 4
I2 5
I3 4
I4 4
I5 2

Step No 2: Sort the item set in descending order

Item Count

I2 5
I1 4
I3 4
I4 4

Step No 3: Construct FP tree

Step No 4: Mining of FP-tree is summarized below

Item Conditional Pattern Base Conditional FP-tree Frequent Patterns Generated

I4 {I2,I1,I3:1},{I2,I3:1} {I2:2, I3:2} {I2,I4:2},{I3,I4:2},{I2,I3,I4:2}


I3 {I2,I1:3},{I2:1} {I2:4, I1:3} {I2,I3:4}, {I1:I3:3}, {I2,I1,I3:3}
I1 {I2:4} {I2:4} {I2,I1:4}

You might also like