You are on page 1of 19

A Pattern – Growth Approach

for Mining Frequent Itemsets

Submitted To: Submitted By:


Dr. Megha Shabnam Choudhary
Assistant Professor M1811984004
CURIN ME Fellowship(CSE)
Improvement of the Apriori Method

Major computational challenges


•Multiple scans of transaction database
•Huge number of candidates
•Tedious workload of support counting for candidates
Improving Apriori: general ideas
•Reduce passes of transaction database scans
•Shrink number of candidates
Proposed Variations to Apriori
Partition: Scan Database Only Twice

• Any itemset that is potentially frequent in DB must be frequent


in at least one of the partitions of DB
– Scan 1: partition database and find local frequent patterns
– Scan 2: consolidate global frequent patterns
Proposed Variations to Apriori

Transaction Reduction(reducing the number of


transactions scanned in future iterations)

• A transaction that does not contain any frequent k-


itemsets cannot contain any frequent (k C1)-itemsets.
Therefore, such a transaction can be marked or
removed from further consideration because
subsequent database scans for j-itemsets, where j >
k, will not need to consider such a transaction.
Proposed Variations to Apriori

Sampling for Frequent Patterns

• Select a sample of original database, mine frequent patterns


within sample using Apriori
• Scan database once to verify frequent itemsets found in
sample.
• Scan database again to find missed frequent patterns

5
Why not Apriori?

The Apriori candidate generate-and-test method significantly


reduces the size of candidate sets, leading to good performance
gain. However, it can suffer from two nontrivial costs:

• It may still need to generate a huge number of candidate sets.


For example, if there are10^4 frequent 1-itemsets, the Apriori
algorithm will need to generate more than 10^7 candidate 2-
itemsets.

• It may need to repeatedly scan the whole database and check a


large set of candidates by pattern matching. It is costly to go
over each transaction in the database to determine the support
of the candidate itemsets.
A Pattern-Growth Approach

“Can we design a method that mines the


complete set of frequent itemsets without
such a costly candidate generation process?”
A Pattern-Growth Approach

An interesting method in this attempt is called frequent pattern


growth, or simply FP-growth, which adopts a divide-and-
conquer strategy as follows
• First, it compresses the database representing frequent items
into a frequent pattern tree, or FP-tree, which retains the
itemset association information.
• It then divides the compressed database into a set of
conditional databases (a special kind of projected database),
each associated with one frequent item or “pattern fragment,”
and mines each database separately.
• Therefore, this approach may substantially reduce the size of
the data sets to be searched, along with the “growth” of
patterns being examined.
FP- Growth (finding frequent itemsets without
candidate generation)
FP-Growth Algorithm Cont….

I2
I1
FP-Growth Algorithm Cont….
Generating FP-Tree
FP-Growth Algorithm Cont….
Mining Frequent Itemsets Using the
Vertical Data Format

Both the Apriori and FP-growth methods mine frequent


patterns from a set of transactions in TID-itemset format (i.e.,
fTID : itemsetg), where TID is a transaction ID and itemset is
the set of items bought in transaction TID. This is known as
the horizontal data format.

• Alternatively, data can be presented in item-TID set format


(i.e., fitem : TID setg/, where item is an item name, and TID set
is the set of transaction identifiers containing the item. This is
known as the vertical data format.
Vertical Data Format Cont..
CONCLUSION

FP-Tree is an efficient algorithm for finding frequent


patterns in transaction databases

• A compact tree structure is used.


• Mining based on the tree structure is significantly more efficient
than Apriori.
Vertical Data Format Cont…
Vertical Data Format Cont…

By intersecting the TID sets of any two corresponding 2-itemsets


of these candidate 3-itemsets, it derives Table 6.5, where there
are only two frequent 3-itemsets: fI1, I2, I3: 2g and fI1, I2, I5: 2g.

You might also like