SlideShare a Scribd company logo
A SEMINAR ON
      THE COMPARATIVE STUDY OF
             APRIORI AND
      FP-GROWTH ALGORITHM FOR
       ASSOCIATION RULE MINING



Under the Guidance of:        By:
Mrs. Sankirti Shiravale
                          Deepti Pawar
Contents
Introduction

Literature Survey

Apriori Algorithm

FP-Growth Algorithm

Comparative Result

Conclusion

Reference
Introduction

 Data Mining: It is the process of discovering interesting patterns (or
 knowledge) from large amount of data.

• Which items are frequently purchased with milk?

• Fraud detection: Which types of transactions are likely to be fraudulent,
  given the demographics and transactional history of a particular customer?

• Customer relationship management: Which of my customers are likely to
  be the most loyal, and which are most likely to leave for a competitor?


  Data Mining helps extract such information
Introduction (contd.)
Why Data Mining?
Broadly, the data mining could be useful to answer the queries on :

• Forecasting

• Classification

• Association

• Clustering

• Making the sequence
Introduction (contd.)
Data Mining Applications
• Aid to marketing or retailing

• Market basket analysis (MBA)

• Medicare and health care

• Criminal investigation and homeland security

• Intrusion detection

• Phenomena of “beer and baby diapers”
  And many more…
Literature Survey
Association Rule Mining
• Proposed by R. Agrawal in 1993.

• It is an important data mining model studied extensively by the database and
  data mining community.

• Initially used for Market Basket Analysis to find how items purchased by
  customers are related.

• Given a set of transactions, find rules that will predict the occurrence of an
  item based on the occurrences of other items in the transaction
Literature Survey (contd.)
 Frequent Itemset
• Itemset                                       TID  Items
  ▫ A collection of one or more items
                                                1    Bread, Milk
       Example: {Milk, Bread, Diaper}
                                                2    Bread, Diaper, Beer, Eggs
  ▫ k-itemset
                                                3    Milk, Diaper, Beer, Coke
       An itemset that contains k items
                                                4    Bread, Milk, Diaper, Beer
• Support count (σ)
                                                5    Bread, Milk, Diaper, Coke
  ▫ Frequency of occurrence of an itemset
  ▫ E.g. σ({Milk, Bread, Diaper}) = 2
• Support
  ▫ Fraction of transactions that contain an itemset
  ▫ E.g. s( {Milk, Bread, Diaper} ) = 2/5
• Frequent Itemset
  ▫ An itemset whose support is greater than or equal
     to a minsup threshold
Literature Survey (contd.)
Association Rule
• Association Rule
  ▫ An implication expression of              TID    Items
    the form X → Y, where X and               1      Bread, Milk
    Y are itemsets.                           2      Bread, Diaper, Beer, Eggs
  ▫ Example:
                                              3      Milk, Diaper, Beer, Coke
      {Milk, Diaper} → {Beer}
                                              4      Bread, Milk, Diaper, Beer
• Rule Evaluation Metrics                     5      Bread, Milk, Diaper, Coke
  ▫ Support (s)
     Fraction of transactions that         Example:
       contain both X and Y                         {Milk, Diaper} ⇒ Beer
  ▫ Confidence (c)
     Measures how often items in           σ (Milk , Diaper, Beer) 2
       Y appear in transactions that   s=                          = = 0.4
       contain X.                                     |T|           5
                                            σ (Milk, Diaper, Beer) 2
                                       c=                         = = 0.67
                                               σ (Milk, Diaper )   3
Apriori Algorithm
• Apriori principle:
  ▫ If an itemset is frequent, then all of its subsets must also be frequent

• Apriori principle holds due to the following property of the support
  measure:
  ▫ Support of an itemset never exceeds the support of its subsets
  ▫ This is known as the anti-monotone property of support
Apriori Algorithm (contd.)
The basic steps to mine the frequent elements are as follows:

• Generate and test: In this first find the 1-itemset frequent elements L1 by
  scanning the database and removing all those elements from C which
  cannot satisfy the minimum support criteria.

• Join step: To attain the next level elements Ck join the previous frequent
  elements by self join i.e. Lk-1*Lk-1 known as Cartesian product of Lk-1 .
  i.e. This step generates new candidate k-itemsets based on joining Lk-1
  with itself which is found in the previous iteration. Let Ck denote
  candidate k-itemset and Lk be the frequent k-itemset.

• Prune step: This step eliminates some of the candidate k-itemsets using the
  Apriori property. A scan of the database to determine the count of each
  candidate in Ck would result in the determination of Lk (i.e., all candidates
  having a count no less than the minimum support count are frequent by
  definition, and therefore belong to Lk). Step 2 and 3 is repeated until no
  new candidate set is generated.
Database           C^1                               L1
                   TID    Set-of- itemsets
TID        Items                                   Itemset           Support
                   100    { {1},{3},{4} }
100        134                                       {1}               2
                   200    { {2},{3},{5} }
200        235                                       {2}               3
                   300    { {1},{2},{3},{5} }
300        1235                                      {3}               3
                   400    { {2},{5} }
400        25                                        {5}               3
      C2
                         C^2                                    L2
itemset            TID     Set-of- itemsets        Itemset           Support
{1 2}              100     { {1 3} }                 {1 3}              2
{1 3}              200     { {2 3},{2 5} {3 5} }     {2 3}              3
{1 5}              300     { {1 2},{1 3},{1 5},      {2 5}              3
{2 3}                      {2 3}, {2 5}, {3 5} }     {3 5}              2
{2 5}              400     { {2 5} }
{3 5}
                         C^3                               L3
      C3
                   TID    Set-of- itemsets
                                                   Itemset           Support
itemset            200    { {2 3 5} }
                                                    {2 3 5}             2
{2 3 5}            300    { {2 3 5} }
Apriori Algorithm (contd.)
Bottlenecks of Apriori
• It is no doubt that Apriori algorithm successfully finds the frequent
  elements from the database. But as the dimensionality of the database
  increase with the number of items then:

• More search space is needed and I/O cost will increase.

• Number of database scan is increased thus candidate generation will
  increase results in increase in computational cost.
FP-Growth Algorithm
 FP-Growth: allows frequent itemset discovery without candidate itemset
  generation. Two step approach:

  ▫ Step 1: Build a compact data structure called the FP-tree
     Built using 2 passes over the data-set.

  ▫ Step 2: Extracts frequent itemsets directly from the FP-tree
FP-Growth Algorithm (contd.)
Step 1: FP-Tree Construction
 FP-Tree is constructed using 2 passes
  over the data-set:
Pass 1:
  ▫ Scan data and find support for each
     item.
  ▫ Discard infrequent items.
  ▫ Sort frequent items in decreasing
     order based on their support.
•   Minimum support count = 2
•   Scan database to find frequent 1-itemsets
•   s(A) = 8, s(B) = 7, s(C) = 5, s(D) = 5, s(E) = 3
•    􀁺 Item order (decreasing support): A, B, C, D, E


    Use this order when building the FP-
    Tree, so common prefixes can be shared.
FP-Growth Algorithm (contd.)
Step 1: FP-Tree Construction
Pass 2:
Nodes correspond to items and have a counter
1.    FP-Growth reads 1 transaction at a time and maps it to a path

2.     Fixed order is used, so paths can overlap when transactions share items
       (when they have the same prefix ).
     ▫     In this case, counters are incremented

3.      Pointers are maintained between nodes containing the same item,
       creating singly linked lists (dotted lines)
     ▫     The more paths that overlap, the higher the compression. FP-tree
           may fit in memory.

4.    Frequent itemsets extracted from the FP-Tree.
FP-Growth Algorithm (contd.)
Step 1: FP-Tree Construction (contd.)
FP-Growth Algorithm (contd.)
Complete FP-Tree for Sample Transactions
FP-Growth Algorithm (contd.)
Step 2: Frequent Itemset Generation
 FP-Growth extracts frequent itemsets from the FP-tree.

 Bottom-up algorithm - from the leaves towards the root

 Divide and conquer: first look for frequent itemsets ending in e, then de,
  etc. . . then d, then cd, etc. . .

 First, extract prefix path sub-trees ending in an item(set). (using the linked
  lists)
FP-Growth Algorithm (contd.)
Prefix path sub-trees (Example)
FP-Growth Algorithm (contd.)
Example
 Let minSup = 2 and extract all frequent itemsets containing E.
  Obtain the prefix path sub-tree for E:

  Check if E is a frequent item by adding the counts along the linked list
   (dotted line). If so, extract it.
   ▫ Yes, count =3 so {E} is extracted as a frequent itemset.

  As E is frequent, find frequent itemsets ending in e. i.e. DE, CE, BE and
   AE.
  E nodes can now be removed
FP-Growth Algorithm (contd.)
Conditional FP-Tree
 The FP-Tree that would be built if we only consider transactions containing
  a particular itemset (and then removing that itemset from all transactions).

 I Example: FP-Tree conditional on e.
FP-Growth Algorithm (contd.)
Current Position in Processing
FP-Growth Algorithm (contd.)
Obtain T(DE) from T(E)
 4. Use the conditional FP-tree for e to find frequent itemsets ending in DE, CE
  and AE
  ▫ Note that BE is not considered as B is not in the conditional FP-tree for E.
• Support count of DE = 2 (sum of counts of all D’s)
• DE is frequent, need to solve: CDE, BDE, ADE if they exist
FP-Growth Algorithm (contd.)
Current Position of Processing
FP-Growth Algorithm (contd.)
Solving CDE, BDE, ADE
 • Sub-trees for both CDE and BDE are empty
 • no prefix paths ending with C or B
 • Working on ADE




ADE (support count = 2) is frequent
solving next sub problem CE
FP-Growth Algorithm (contd.)
Current Position in Processing
FP-Growth Algorithm (contd.)
Solving for Suffix CE




  CE is frequent (support count = 2)
• Work on next sub problems: BE (no support), AE
FP-Growth Algorithm (contd.)
Current Position in Processing
FP-Growth Algorithm (contd.)
Solving for Suffix AE




  AE is frequent (support count = 2)
  Done with AE
  Work on next sub problem: suffix D
FP-Growth Algorithm (contd.)
Found Frequent Itemsets with Suffix E
 • E, DE, ADE, CE, AE discovered in this order
FP-Growth Algorithm (contd.)
Example (contd.)
Frequent itemsets found (ordered by suffix and order in which the are
  found):
Comparative Result
Conclusion

  It is found that:

• FP-tree: a novel data structure storing compressed, crucial information
  about frequent patterns, compact yet complete for frequent pattern mining.

• FP-growth: an efficient mining method of frequent patterns in large
  Database: using a highly compact FP-tree, divide-and-conquer method in
  nature.

• Both Apriori and FP-Growth are aiming to find out complete set of patterns
  but, FP-Growth is more efficient than Apriori in respect to long patterns.
References
1.   Liwu, ZOU, Guangwei, REN, “The data mining algorithm analysis for
     personalized service,” Fourth International Conference on Multimedia
     Information Networking and Security, 2012.

2.   Jun TAN, Yingyong BU and Bo YANG, “An Efficient Frequent Pattern
     Mining Algorithm”, Sixth International Conference on Fuzzy Systems and
     Knowledge Discovery, 2009.

3.   Wei Zhang, Hongzhi Liao, Na Zhao, “Research on the FP Growth Algorithm
     about Association Rule Mining”, International Seminar on Business and
     Information Management, 2008.

4.   S.P Latha, DR. N.Ramaraj. “Algorithm for Efficient Data Mining”. In Proc.
     Int’ Conf. on IEEE International Computational Intelligence and Multimedia
     Applications, 2007.
References (contd.)
5.   Dongme Sun, Shaohua Teng, Wei Zhang, Haibin Zhu. “An Algorithm to
     Improve the Effectiveness of Apriori”. In Proc. Int’l Conf. on 6th IEEE
     International Conf. on Cognitive Informatics (ICCI'07), 2007.

6.   Daniel Hunyadi, “Performance comparison of Apriori and FP-Growth
     algorithms in generating association rules”, Proceedings of the European
     Computing Conference, 2006.

7.   By Jiawei Han, Micheline Kamber, “Data mining Concepts and
     Techniques” Morgan Kaufmann Publishers, 2006.

8.   Tan P.-N., Steinbach M., and Kumar V. “Introduction to data mining”
     Addison Wesley Publishers, 2006.
References (contd.)


9.    Han.J, Pei.J, and Yin. Y. “Mining frequent patterns without candidate
     generation”. In Proc. ACM-SIGMOD International Conf. Management
     of Data (SIGMOD), 2000.

10. R. Agrawal, Imielinski.t, Swami.A. “Mining Association Rules between
    Sets of Items in Large Databases”. In Proc. International Conf. of the
    ACM SIGMOD Conference Washington DC, USA, 1993.
Ad

More Related Content

What's hot (20)

Introduction to Hadoop
Introduction to HadoopIntroduction to Hadoop
Introduction to Hadoop
Apache Apex
 
Apriori algorithm
Apriori algorithmApriori algorithm
Apriori algorithm
Mainul Hassan
 
Lect6 Association rule & Apriori algorithm
Lect6 Association rule & Apriori algorithmLect6 Association rule & Apriori algorithm
Lect6 Association rule & Apriori algorithm
hktripathy
 
Naive Bayes Classifier
Naive Bayes ClassifierNaive Bayes Classifier
Naive Bayes Classifier
Arunabha Saha
 
Big Data Analytics with Hadoop
Big Data Analytics with HadoopBig Data Analytics with Hadoop
Big Data Analytics with Hadoop
Philippe Julio
 
Data Cleaning Techniques
Data Cleaning TechniquesData Cleaning Techniques
Data Cleaning Techniques
Amir Masoud Sefidian
 
Association Analysis in Data Mining
Association Analysis in Data MiningAssociation Analysis in Data Mining
Association Analysis in Data Mining
Kamal Acharya
 
DBSCAN : A Clustering Algorithm
DBSCAN : A Clustering AlgorithmDBSCAN : A Clustering Algorithm
DBSCAN : A Clustering Algorithm
Pınar Yahşi
 
Apache Ranger Hive Metastore Security
Apache Ranger Hive Metastore Security Apache Ranger Hive Metastore Security
Apache Ranger Hive Metastore Security
DataWorks Summit/Hadoop Summit
 
Understanding Association Rule Mining
Understanding Association Rule MiningUnderstanding Association Rule Mining
Understanding Association Rule Mining
Mohit Rajput
 
How Lyft Drives Data Discovery
How Lyft Drives Data DiscoveryHow Lyft Drives Data Discovery
How Lyft Drives Data Discovery
Neo4j
 
Lect7 Association analysis to correlation analysis
Lect7 Association analysis to correlation analysisLect7 Association analysis to correlation analysis
Lect7 Association analysis to correlation analysis
hktripathy
 
K - Nearest neighbor ( KNN )
K - Nearest neighbor  ( KNN )K - Nearest neighbor  ( KNN )
K - Nearest neighbor ( KNN )
Mohammad Junaid Khan
 
Feature Engineering
Feature EngineeringFeature Engineering
Feature Engineering
Sri Ambati
 
An Introduction to Apache Hadoop Yarn
An Introduction to Apache Hadoop YarnAn Introduction to Apache Hadoop Yarn
An Introduction to Apache Hadoop Yarn
Mike Frampton
 
Data Mining: Association Rules Basics
Data Mining: Association Rules BasicsData Mining: Association Rules Basics
Data Mining: Association Rules Basics
Benazir Income Support Program (BISP)
 
Assosiate rule mining
Assosiate rule miningAssosiate rule mining
Assosiate rule mining
Tilani Gunawardena PhD(UNIBAS), BSc(Pera), FHEA(UK), CEng, MIESL
 
Association Rule Learning Part 1: Frequent Itemset Generation
Association Rule Learning Part 1: Frequent Itemset GenerationAssociation Rule Learning Part 1: Frequent Itemset Generation
Association Rule Learning Part 1: Frequent Itemset Generation
Knoldus Inc.
 
Hadoop Adventures At Spotify (Strata Conference + Hadoop World 2013)
Hadoop Adventures At Spotify (Strata Conference + Hadoop World 2013)Hadoop Adventures At Spotify (Strata Conference + Hadoop World 2013)
Hadoop Adventures At Spotify (Strata Conference + Hadoop World 2013)
Adam Kawa
 
Apache Spark & Hadoop
Apache Spark & HadoopApache Spark & Hadoop
Apache Spark & Hadoop
MapR Technologies
 
Introduction to Hadoop
Introduction to HadoopIntroduction to Hadoop
Introduction to Hadoop
Apache Apex
 
Lect6 Association rule & Apriori algorithm
Lect6 Association rule & Apriori algorithmLect6 Association rule & Apriori algorithm
Lect6 Association rule & Apriori algorithm
hktripathy
 
Naive Bayes Classifier
Naive Bayes ClassifierNaive Bayes Classifier
Naive Bayes Classifier
Arunabha Saha
 
Big Data Analytics with Hadoop
Big Data Analytics with HadoopBig Data Analytics with Hadoop
Big Data Analytics with Hadoop
Philippe Julio
 
Association Analysis in Data Mining
Association Analysis in Data MiningAssociation Analysis in Data Mining
Association Analysis in Data Mining
Kamal Acharya
 
DBSCAN : A Clustering Algorithm
DBSCAN : A Clustering AlgorithmDBSCAN : A Clustering Algorithm
DBSCAN : A Clustering Algorithm
Pınar Yahşi
 
Understanding Association Rule Mining
Understanding Association Rule MiningUnderstanding Association Rule Mining
Understanding Association Rule Mining
Mohit Rajput
 
How Lyft Drives Data Discovery
How Lyft Drives Data DiscoveryHow Lyft Drives Data Discovery
How Lyft Drives Data Discovery
Neo4j
 
Lect7 Association analysis to correlation analysis
Lect7 Association analysis to correlation analysisLect7 Association analysis to correlation analysis
Lect7 Association analysis to correlation analysis
hktripathy
 
Feature Engineering
Feature EngineeringFeature Engineering
Feature Engineering
Sri Ambati
 
An Introduction to Apache Hadoop Yarn
An Introduction to Apache Hadoop YarnAn Introduction to Apache Hadoop Yarn
An Introduction to Apache Hadoop Yarn
Mike Frampton
 
Association Rule Learning Part 1: Frequent Itemset Generation
Association Rule Learning Part 1: Frequent Itemset GenerationAssociation Rule Learning Part 1: Frequent Itemset Generation
Association Rule Learning Part 1: Frequent Itemset Generation
Knoldus Inc.
 
Hadoop Adventures At Spotify (Strata Conference + Hadoop World 2013)
Hadoop Adventures At Spotify (Strata Conference + Hadoop World 2013)Hadoop Adventures At Spotify (Strata Conference + Hadoop World 2013)
Hadoop Adventures At Spotify (Strata Conference + Hadoop World 2013)
Adam Kawa
 

Similar to The comparative study of apriori and FP-growth algorithm (20)

Rules of data mining
Rules of data miningRules of data mining
Rules of data mining
Sulman Ahmed
 
Rules of data mining
Rules of data miningRules of data mining
Rules of data mining
Sulman Ahmed
 
Data Mining Lecture_3.pptx
Data Mining Lecture_3.pptxData Mining Lecture_3.pptx
Data Mining Lecture_3.pptx
Subrata Kumer Paul
 
AssociationRule.pdf
AssociationRule.pdfAssociationRule.pdf
AssociationRule.pdf
WailaBaba
 
Data Mining Lecture_4.pptx
Data Mining Lecture_4.pptxData Mining Lecture_4.pptx
Data Mining Lecture_4.pptx
Subrata Kumer Paul
 
DM -Unit 2-PPT.ppt
DM -Unit 2-PPT.pptDM -Unit 2-PPT.ppt
DM -Unit 2-PPT.ppt
raju980973
 
Apriori and Eclat algorithm in Association Rule Mining
Apriori and Eclat algorithm in Association Rule MiningApriori and Eclat algorithm in Association Rule Mining
Apriori and Eclat algorithm in Association Rule Mining
Wan Aezwani Wab
 
apriori.pptx
apriori.pptxapriori.pptx
apriori.pptx
selvifitria1
 
Data Mining Concepts 15061
Data Mining Concepts 15061Data Mining Concepts 15061
Data Mining Concepts 15061
badirh
 
Data Mining Concepts
Data Mining ConceptsData Mining Concepts
Data Mining Concepts
Dung Nguyen
 
Data Mining Concepts
Data Mining ConceptsData Mining Concepts
Data Mining Concepts
dataminers.ir
 
Improved aproiri algorithm by FP tree.pptx
Improved aproiri algorithm by FP tree.pptxImproved aproiri algorithm by FP tree.pptx
Improved aproiri algorithm by FP tree.pptx
khaledrahman15
 
MCA-IV_DataMining16_DataMining_AssociationRules_APriori_Keerti_Dixit.pdf
MCA-IV_DataMining16_DataMining_AssociationRules_APriori_Keerti_Dixit.pdfMCA-IV_DataMining16_DataMining_AssociationRules_APriori_Keerti_Dixit.pdf
MCA-IV_DataMining16_DataMining_AssociationRules_APriori_Keerti_Dixit.pdf
AlexanderMndez18
 
Data Mining Association Analysis Basic Concepts a
Data Mining Association Analysis Basic Concepts aData Mining Association Analysis Basic Concepts a
Data Mining Association Analysis Basic Concepts a
OllieShoresna
 
Feequent Item Mining - Data Mining - Pattern Mining
Feequent Item Mining - Data Mining - Pattern MiningFeequent Item Mining - Data Mining - Pattern Mining
Feequent Item Mining - Data Mining - Pattern Mining
Jason J Pulikkottil
 
Associative Learning
Associative LearningAssociative Learning
Associative Learning
Indrajit Sreemany
 
Association Rule Mining
Association Rule MiningAssociation Rule Mining
Association Rule Mining
PALLAB DAS
 
Data mining techniques unit III
Data mining techniques unit IIIData mining techniques unit III
Data mining techniques unit III
malathieswaran29
 
Rmining
RminingRmining
Rmining
wolverine1309
 
My6asso
My6assoMy6asso
My6asso
ketan533
 
Rules of data mining
Rules of data miningRules of data mining
Rules of data mining
Sulman Ahmed
 
Rules of data mining
Rules of data miningRules of data mining
Rules of data mining
Sulman Ahmed
 
AssociationRule.pdf
AssociationRule.pdfAssociationRule.pdf
AssociationRule.pdf
WailaBaba
 
DM -Unit 2-PPT.ppt
DM -Unit 2-PPT.pptDM -Unit 2-PPT.ppt
DM -Unit 2-PPT.ppt
raju980973
 
Apriori and Eclat algorithm in Association Rule Mining
Apriori and Eclat algorithm in Association Rule MiningApriori and Eclat algorithm in Association Rule Mining
Apriori and Eclat algorithm in Association Rule Mining
Wan Aezwani Wab
 
Data Mining Concepts 15061
Data Mining Concepts 15061Data Mining Concepts 15061
Data Mining Concepts 15061
badirh
 
Data Mining Concepts
Data Mining ConceptsData Mining Concepts
Data Mining Concepts
Dung Nguyen
 
Data Mining Concepts
Data Mining ConceptsData Mining Concepts
Data Mining Concepts
dataminers.ir
 
Improved aproiri algorithm by FP tree.pptx
Improved aproiri algorithm by FP tree.pptxImproved aproiri algorithm by FP tree.pptx
Improved aproiri algorithm by FP tree.pptx
khaledrahman15
 
MCA-IV_DataMining16_DataMining_AssociationRules_APriori_Keerti_Dixit.pdf
MCA-IV_DataMining16_DataMining_AssociationRules_APriori_Keerti_Dixit.pdfMCA-IV_DataMining16_DataMining_AssociationRules_APriori_Keerti_Dixit.pdf
MCA-IV_DataMining16_DataMining_AssociationRules_APriori_Keerti_Dixit.pdf
AlexanderMndez18
 
Data Mining Association Analysis Basic Concepts a
Data Mining Association Analysis Basic Concepts aData Mining Association Analysis Basic Concepts a
Data Mining Association Analysis Basic Concepts a
OllieShoresna
 
Feequent Item Mining - Data Mining - Pattern Mining
Feequent Item Mining - Data Mining - Pattern MiningFeequent Item Mining - Data Mining - Pattern Mining
Feequent Item Mining - Data Mining - Pattern Mining
Jason J Pulikkottil
 
Association Rule Mining
Association Rule MiningAssociation Rule Mining
Association Rule Mining
PALLAB DAS
 
Data mining techniques unit III
Data mining techniques unit IIIData mining techniques unit III
Data mining techniques unit III
malathieswaran29
 
Ad

Recently uploaded (20)

GDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptxGDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptx
azeenhodekar
 
How to Manage Opening & Closing Controls in Odoo 17 POS
How to Manage Opening & Closing Controls in Odoo 17 POSHow to Manage Opening & Closing Controls in Odoo 17 POS
How to Manage Opening & Closing Controls in Odoo 17 POS
Celine George
 
Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025
Mebane Rash
 
Quality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdfQuality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdf
Dr. Bindiya Chauhan
 
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
Celine George
 
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Celine George
 
Presentation on Tourism Product Development By Md Shaifullar Rabbi
Presentation on Tourism Product Development By Md Shaifullar RabbiPresentation on Tourism Product Development By Md Shaifullar Rabbi
Presentation on Tourism Product Development By Md Shaifullar Rabbi
Md Shaifullar Rabbi
 
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam SuccessUltimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Mark Soia
 
YSPH VMOC Special Report - Measles Outbreak Southwest US 4-30-2025.pptx
YSPH VMOC Special Report - Measles Outbreak  Southwest US 4-30-2025.pptxYSPH VMOC Special Report - Measles Outbreak  Southwest US 4-30-2025.pptx
YSPH VMOC Special Report - Measles Outbreak Southwest US 4-30-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Library Association of Ireland
 
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
larencebapu132
 
New Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptxNew Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptx
milanasargsyan5
 
Presentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem KayaPresentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem Kaya
MIPLM
 
To study the nervous system of insect.pptx
To study the nervous system of insect.pptxTo study the nervous system of insect.pptx
To study the nervous system of insect.pptx
Arshad Shaikh
 
Biophysics Chapter 3 Methods of Studying Macromolecules.pdf
Biophysics Chapter 3 Methods of Studying Macromolecules.pdfBiophysics Chapter 3 Methods of Studying Macromolecules.pdf
Biophysics Chapter 3 Methods of Studying Macromolecules.pdf
PKLI-Institute of Nursing and Allied Health Sciences Lahore , Pakistan.
 
How to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 WebsiteHow to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 Website
Celine George
 
Understanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s GuideUnderstanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s Guide
GS Virdi
 
Unit 6_Introduction_Phishing_Password Cracking.pdf
Unit 6_Introduction_Phishing_Password Cracking.pdfUnit 6_Introduction_Phishing_Password Cracking.pdf
Unit 6_Introduction_Phishing_Password Cracking.pdf
KanchanPatil34
 
How to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of saleHow to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of sale
Celine George
 
LDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini UpdatesLDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini Updates
LDM Mia eStudios
 
GDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptxGDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptx
azeenhodekar
 
How to Manage Opening & Closing Controls in Odoo 17 POS
How to Manage Opening & Closing Controls in Odoo 17 POSHow to Manage Opening & Closing Controls in Odoo 17 POS
How to Manage Opening & Closing Controls in Odoo 17 POS
Celine George
 
Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025
Mebane Rash
 
Quality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdfQuality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdf
Dr. Bindiya Chauhan
 
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
Celine George
 
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Celine George
 
Presentation on Tourism Product Development By Md Shaifullar Rabbi
Presentation on Tourism Product Development By Md Shaifullar RabbiPresentation on Tourism Product Development By Md Shaifullar Rabbi
Presentation on Tourism Product Development By Md Shaifullar Rabbi
Md Shaifullar Rabbi
 
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam SuccessUltimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Mark Soia
 
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Library Association of Ireland
 
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
larencebapu132
 
New Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptxNew Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptx
milanasargsyan5
 
Presentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem KayaPresentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem Kaya
MIPLM
 
To study the nervous system of insect.pptx
To study the nervous system of insect.pptxTo study the nervous system of insect.pptx
To study the nervous system of insect.pptx
Arshad Shaikh
 
How to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 WebsiteHow to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 Website
Celine George
 
Understanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s GuideUnderstanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s Guide
GS Virdi
 
Unit 6_Introduction_Phishing_Password Cracking.pdf
Unit 6_Introduction_Phishing_Password Cracking.pdfUnit 6_Introduction_Phishing_Password Cracking.pdf
Unit 6_Introduction_Phishing_Password Cracking.pdf
KanchanPatil34
 
How to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of saleHow to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of sale
Celine George
 
LDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini UpdatesLDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini Updates
LDM Mia eStudios
 
Ad

The comparative study of apriori and FP-growth algorithm

  • 1. A SEMINAR ON THE COMPARATIVE STUDY OF APRIORI AND FP-GROWTH ALGORITHM FOR ASSOCIATION RULE MINING Under the Guidance of: By: Mrs. Sankirti Shiravale Deepti Pawar
  • 2. Contents Introduction Literature Survey Apriori Algorithm FP-Growth Algorithm Comparative Result Conclusion Reference
  • 3. Introduction Data Mining: It is the process of discovering interesting patterns (or knowledge) from large amount of data. • Which items are frequently purchased with milk? • Fraud detection: Which types of transactions are likely to be fraudulent, given the demographics and transactional history of a particular customer? • Customer relationship management: Which of my customers are likely to be the most loyal, and which are most likely to leave for a competitor? Data Mining helps extract such information
  • 4. Introduction (contd.) Why Data Mining? Broadly, the data mining could be useful to answer the queries on : • Forecasting • Classification • Association • Clustering • Making the sequence
  • 5. Introduction (contd.) Data Mining Applications • Aid to marketing or retailing • Market basket analysis (MBA) • Medicare and health care • Criminal investigation and homeland security • Intrusion detection • Phenomena of “beer and baby diapers” And many more…
  • 6. Literature Survey Association Rule Mining • Proposed by R. Agrawal in 1993. • It is an important data mining model studied extensively by the database and data mining community. • Initially used for Market Basket Analysis to find how items purchased by customers are related. • Given a set of transactions, find rules that will predict the occurrence of an item based on the occurrences of other items in the transaction
  • 7. Literature Survey (contd.) Frequent Itemset • Itemset TID Items ▫ A collection of one or more items 1 Bread, Milk  Example: {Milk, Bread, Diaper} 2 Bread, Diaper, Beer, Eggs ▫ k-itemset 3 Milk, Diaper, Beer, Coke  An itemset that contains k items 4 Bread, Milk, Diaper, Beer • Support count (σ) 5 Bread, Milk, Diaper, Coke ▫ Frequency of occurrence of an itemset ▫ E.g. σ({Milk, Bread, Diaper}) = 2 • Support ▫ Fraction of transactions that contain an itemset ▫ E.g. s( {Milk, Bread, Diaper} ) = 2/5 • Frequent Itemset ▫ An itemset whose support is greater than or equal to a minsup threshold
  • 8. Literature Survey (contd.) Association Rule • Association Rule ▫ An implication expression of TID Items the form X → Y, where X and 1 Bread, Milk Y are itemsets. 2 Bread, Diaper, Beer, Eggs ▫ Example: 3 Milk, Diaper, Beer, Coke {Milk, Diaper} → {Beer} 4 Bread, Milk, Diaper, Beer • Rule Evaluation Metrics 5 Bread, Milk, Diaper, Coke ▫ Support (s)  Fraction of transactions that Example: contain both X and Y {Milk, Diaper} ⇒ Beer ▫ Confidence (c)  Measures how often items in σ (Milk , Diaper, Beer) 2 Y appear in transactions that s= = = 0.4 contain X. |T| 5 σ (Milk, Diaper, Beer) 2 c= = = 0.67 σ (Milk, Diaper ) 3
  • 9. Apriori Algorithm • Apriori principle: ▫ If an itemset is frequent, then all of its subsets must also be frequent • Apriori principle holds due to the following property of the support measure: ▫ Support of an itemset never exceeds the support of its subsets ▫ This is known as the anti-monotone property of support
  • 10. Apriori Algorithm (contd.) The basic steps to mine the frequent elements are as follows: • Generate and test: In this first find the 1-itemset frequent elements L1 by scanning the database and removing all those elements from C which cannot satisfy the minimum support criteria. • Join step: To attain the next level elements Ck join the previous frequent elements by self join i.e. Lk-1*Lk-1 known as Cartesian product of Lk-1 . i.e. This step generates new candidate k-itemsets based on joining Lk-1 with itself which is found in the previous iteration. Let Ck denote candidate k-itemset and Lk be the frequent k-itemset. • Prune step: This step eliminates some of the candidate k-itemsets using the Apriori property. A scan of the database to determine the count of each candidate in Ck would result in the determination of Lk (i.e., all candidates having a count no less than the minimum support count are frequent by definition, and therefore belong to Lk). Step 2 and 3 is repeated until no new candidate set is generated.
  • 11. Database C^1 L1 TID Set-of- itemsets TID Items Itemset Support 100 { {1},{3},{4} } 100 134 {1} 2 200 { {2},{3},{5} } 200 235 {2} 3 300 { {1},{2},{3},{5} } 300 1235 {3} 3 400 { {2},{5} } 400 25 {5} 3 C2 C^2 L2 itemset TID Set-of- itemsets Itemset Support {1 2} 100 { {1 3} } {1 3} 2 {1 3} 200 { {2 3},{2 5} {3 5} } {2 3} 3 {1 5} 300 { {1 2},{1 3},{1 5}, {2 5} 3 {2 3} {2 3}, {2 5}, {3 5} } {3 5} 2 {2 5} 400 { {2 5} } {3 5} C^3 L3 C3 TID Set-of- itemsets Itemset Support itemset 200 { {2 3 5} } {2 3 5} 2 {2 3 5} 300 { {2 3 5} }
  • 12. Apriori Algorithm (contd.) Bottlenecks of Apriori • It is no doubt that Apriori algorithm successfully finds the frequent elements from the database. But as the dimensionality of the database increase with the number of items then: • More search space is needed and I/O cost will increase. • Number of database scan is increased thus candidate generation will increase results in increase in computational cost.
  • 13. FP-Growth Algorithm  FP-Growth: allows frequent itemset discovery without candidate itemset generation. Two step approach: ▫ Step 1: Build a compact data structure called the FP-tree  Built using 2 passes over the data-set. ▫ Step 2: Extracts frequent itemsets directly from the FP-tree
  • 14. FP-Growth Algorithm (contd.) Step 1: FP-Tree Construction  FP-Tree is constructed using 2 passes over the data-set: Pass 1: ▫ Scan data and find support for each item. ▫ Discard infrequent items. ▫ Sort frequent items in decreasing order based on their support. • Minimum support count = 2 • Scan database to find frequent 1-itemsets • s(A) = 8, s(B) = 7, s(C) = 5, s(D) = 5, s(E) = 3 • 􀁺 Item order (decreasing support): A, B, C, D, E Use this order when building the FP- Tree, so common prefixes can be shared.
  • 15. FP-Growth Algorithm (contd.) Step 1: FP-Tree Construction Pass 2: Nodes correspond to items and have a counter 1. FP-Growth reads 1 transaction at a time and maps it to a path 2. Fixed order is used, so paths can overlap when transactions share items (when they have the same prefix ). ▫ In this case, counters are incremented 3. Pointers are maintained between nodes containing the same item, creating singly linked lists (dotted lines) ▫ The more paths that overlap, the higher the compression. FP-tree may fit in memory. 4. Frequent itemsets extracted from the FP-Tree.
  • 16. FP-Growth Algorithm (contd.) Step 1: FP-Tree Construction (contd.)
  • 17. FP-Growth Algorithm (contd.) Complete FP-Tree for Sample Transactions
  • 18. FP-Growth Algorithm (contd.) Step 2: Frequent Itemset Generation  FP-Growth extracts frequent itemsets from the FP-tree.  Bottom-up algorithm - from the leaves towards the root  Divide and conquer: first look for frequent itemsets ending in e, then de, etc. . . then d, then cd, etc. . .  First, extract prefix path sub-trees ending in an item(set). (using the linked lists)
  • 19. FP-Growth Algorithm (contd.) Prefix path sub-trees (Example)
  • 20. FP-Growth Algorithm (contd.) Example Let minSup = 2 and extract all frequent itemsets containing E.  Obtain the prefix path sub-tree for E:  Check if E is a frequent item by adding the counts along the linked list (dotted line). If so, extract it. ▫ Yes, count =3 so {E} is extracted as a frequent itemset.  As E is frequent, find frequent itemsets ending in e. i.e. DE, CE, BE and AE.  E nodes can now be removed
  • 21. FP-Growth Algorithm (contd.) Conditional FP-Tree  The FP-Tree that would be built if we only consider transactions containing a particular itemset (and then removing that itemset from all transactions).  I Example: FP-Tree conditional on e.
  • 22. FP-Growth Algorithm (contd.) Current Position in Processing
  • 23. FP-Growth Algorithm (contd.) Obtain T(DE) from T(E)  4. Use the conditional FP-tree for e to find frequent itemsets ending in DE, CE and AE ▫ Note that BE is not considered as B is not in the conditional FP-tree for E. • Support count of DE = 2 (sum of counts of all D’s) • DE is frequent, need to solve: CDE, BDE, ADE if they exist
  • 24. FP-Growth Algorithm (contd.) Current Position of Processing
  • 25. FP-Growth Algorithm (contd.) Solving CDE, BDE, ADE • Sub-trees for both CDE and BDE are empty • no prefix paths ending with C or B • Working on ADE ADE (support count = 2) is frequent solving next sub problem CE
  • 26. FP-Growth Algorithm (contd.) Current Position in Processing
  • 27. FP-Growth Algorithm (contd.) Solving for Suffix CE CE is frequent (support count = 2) • Work on next sub problems: BE (no support), AE
  • 28. FP-Growth Algorithm (contd.) Current Position in Processing
  • 29. FP-Growth Algorithm (contd.) Solving for Suffix AE AE is frequent (support count = 2) Done with AE Work on next sub problem: suffix D
  • 30. FP-Growth Algorithm (contd.) Found Frequent Itemsets with Suffix E • E, DE, ADE, CE, AE discovered in this order
  • 31. FP-Growth Algorithm (contd.) Example (contd.) Frequent itemsets found (ordered by suffix and order in which the are found):
  • 33. Conclusion It is found that: • FP-tree: a novel data structure storing compressed, crucial information about frequent patterns, compact yet complete for frequent pattern mining. • FP-growth: an efficient mining method of frequent patterns in large Database: using a highly compact FP-tree, divide-and-conquer method in nature. • Both Apriori and FP-Growth are aiming to find out complete set of patterns but, FP-Growth is more efficient than Apriori in respect to long patterns.
  • 34. References 1. Liwu, ZOU, Guangwei, REN, “The data mining algorithm analysis for personalized service,” Fourth International Conference on Multimedia Information Networking and Security, 2012. 2. Jun TAN, Yingyong BU and Bo YANG, “An Efficient Frequent Pattern Mining Algorithm”, Sixth International Conference on Fuzzy Systems and Knowledge Discovery, 2009. 3. Wei Zhang, Hongzhi Liao, Na Zhao, “Research on the FP Growth Algorithm about Association Rule Mining”, International Seminar on Business and Information Management, 2008. 4. S.P Latha, DR. N.Ramaraj. “Algorithm for Efficient Data Mining”. In Proc. Int’ Conf. on IEEE International Computational Intelligence and Multimedia Applications, 2007.
  • 35. References (contd.) 5. Dongme Sun, Shaohua Teng, Wei Zhang, Haibin Zhu. “An Algorithm to Improve the Effectiveness of Apriori”. In Proc. Int’l Conf. on 6th IEEE International Conf. on Cognitive Informatics (ICCI'07), 2007. 6. Daniel Hunyadi, “Performance comparison of Apriori and FP-Growth algorithms in generating association rules”, Proceedings of the European Computing Conference, 2006. 7. By Jiawei Han, Micheline Kamber, “Data mining Concepts and Techniques” Morgan Kaufmann Publishers, 2006. 8. Tan P.-N., Steinbach M., and Kumar V. “Introduction to data mining” Addison Wesley Publishers, 2006.
  • 36. References (contd.) 9. Han.J, Pei.J, and Yin. Y. “Mining frequent patterns without candidate generation”. In Proc. ACM-SIGMOD International Conf. Management of Data (SIGMOD), 2000. 10. R. Agrawal, Imielinski.t, Swami.A. “Mining Association Rules between Sets of Items in Large Databases”. In Proc. International Conf. of the ACM SIGMOD Conference Washington DC, USA, 1993.

Editor's Notes

  • #12: Minimum support = 2 C^2 גדול יותר אבל בשלב הבא נהיה קטן .