SlideShare a Scribd company logo
DATA MINING AND WARE HOUSING
(FP GROWTH ALGORITHM EXAMPLE)
MADE BY: MANISH MESHRAM (203441006) GUIDED BY:
DR.DIPALI MEHER
SHREYA KALEKAR (203441009)
SWATI BOTE (203441015)
YASH CHITNIS (203441020)
VINAY BHOSALE (203441027)
MODERN COLLEGE OF ARTS, SCIENCE &
COMMERCE, GANESHKHIND.
DEPARTMENT: COMPUTER SCIENCE(M.Sc.
I (CA))
•FP Growth Algorithm (Frequent pattern
growth). FP growth algorithm is an improvement
of Apriori algorithm. FP growth algorithm used
for finding frequent itemset in a transaction
database without candidate generation.
•FP growth represents frequent items in frequent
pattern trees or FP-tree.
Apply the FP tree algorithm for the
given transactional database with the
minimum support of 4.
Transaction ID List of Items
T1 Milk, Bread, Butter
T2 Bread, Milk
T3 Sugar, Milk, Bread
T4 Bread, Butter
T5 Bread, Butter, Milk
T6 Milk, Sugar
T7 Milk, Bread, Butter
T8 Milk, Butter
STEP 1: Find out the frequency of
occurrence of each item in the database.
ITEMS FREQUENC
Y
Milk 7
Bread 6
Butter 5
Sugar 2
Transaction
ID
List of
Items
T1 Milk, Bread,
Butter
T2 Bread, Milk
T3 Sugar, Milk,
Bread
T4 Bread, Butter
T5 Bread, Butter,
Milk
T6 Milk, Sugar
Table2: Frequency of
occurrence
Table
1
Table
2
STEP 2: Prioritize the item. Give the priority to
each item according to its frequency of
occurrence.
ITEMS FREQUENCY
Milk 7
Bread 6
Butter 5
Sugar 2
Table
2 ITEMS FREQUENCY
Milk 7
Bread 6
Butter 5
Sugar 2
PRIORITY
1
2
3
4
Table
3
STEP 3: Order the items according to the
priorities in a tabular format.
Transaction
ID
List of Items
T1 Milk, Bread,
Butter
T2 Bread, Milk
T3 Sugar, Milk, Bread
T4 Bread, Butter
T5 Bread, Butter,
Milk
T6 Milk, Sugar
T7 Milk, Bread,
Ordered
Items
Milk, Bread,
Butter
Milk, Bread
Milk, Bread,
Sugar
Bread, Butter
Milk, Bread,
Butter
Milk, Sugar
Table
4
New version of
Table 1
1
2
3
4
STEP 4: Order the items according to
priority in an FP Tree format.
• Row 1: Lets take the
items of row 1 (Milk: M,
Bread: BR, Butter: B)
and arrange them one
by one respectively. All
FP Tree have a “null”
node and a “root”
node.
NUL
L
M:1
BR:
1
B:1
CONTINUE UPDATING THE TREE
• Row 2: Lets take the
items of row 2(Milk:
M, Bread: B).
Continue updating
the occurrence of
the items.
NULL
M:2
BR:
2
B:1
CONTINUE UPDATING THE TREE
• Row 3: Lets take the
items from the third
row( Milk: M, Bread: BR,
Sugar: S). Here new root
node will be created
which will connect ‘BR’
i.e., ‘S’. Update the
occurrence of the items.
NUL
L
M:3
BR:
3
B:1 S:1
CONTINUE ADDING THE ITEMS FROM THE
FORTH ROW
• Row 4: Lets take the
items from the forth
row(Bread: BR, Butter: B).
Here new root node will
be generated from the
null node. Write the
occurrence of the items
as well.
NULL
M:3
BR:3
B:1 S:1
BR:
1
B:1
CONTINUE ADDING THE ITEMS IN THE TREE
• Row 5: Lets add the
items from the fifth
row( Milk: M, Bread:
BR, Butter: B ). It will
continue with the
previous node it self
only the occurrence of
the items will be
changed.
NUL
L
M:4
BR:4
B:2 S:1
BR:1
B:1
CONTINUE ADDING THE ITEMS IN THE TREE
• Row 6: Lets add the items
from the sixth row( Milk: M,
Sugar: S). Item Sugar will be
added to the Milk node that
means a new node will be
generated.
NUL
L
M:5
BR:4
B:2 S:1
S:1
BR:1
B:1
KEEP ON ADDING THE ITEMS OF THE
SEVENTH ROW
• Row 7: Lets take the
items of seventh row
(Milk: M, Bread: BR,
Butter: B). It will continue
in the previous nodes
itself. Only the
occurrences will be
increased.
NULL
M:6
BR:5
B:3
S:1
S:1
BR:1
B:1
KEEP ON ADDING THE ITEMS OF THE LAST
ROW
• Row 8: Lets add the
items from the eight
row( Milk: M, Butter:
B). Item Butter will be
added to the Milk
node that means a
new node will be
generated.
NUL
L
M:7
BR:5
B:1
B:3
S:1
S:1
BR:1
B:1
FINAL FP
TREE
STEP 5: VALIDATION
• To know whether the FP Tree is correct or not.
• Check the count of frequency of occurrence of each
item with the help of Table 2.
• If the frequency of the both Table and Tree matches
then the FP Tree is correct.
COUNT THE FREQUENCY OF OOCURRENCE
ITEMS FREQUENC
Y
Milk 7
Bread 6
Butter 5
Sugar 2
Table
2
NUL
L
M:7
B:1 BR:5 S:1
B:3 S:1
BR:1
B:1
Fp growth algorithm

More Related Content

What's hot

Data Structure and Algorithms Binary Search Tree
Data Structure and Algorithms Binary Search TreeData Structure and Algorithms Binary Search Tree
Data Structure and Algorithms Binary Search Tree
ManishPrajapati78
 
Frequent Pattern Growth Algorithm (FP growth method)
Frequent Pattern Growth Algorithm (FP growth method)Frequent Pattern Growth Algorithm (FP growth method)
Frequent Pattern Growth Algorithm (FP growth method)
Ashis Chanda
 
Frequent Pattern growth algorithm
Frequent Pattern growth algorithmFrequent Pattern growth algorithm
Frequent Pattern growth algorithm
Ashis Kumar Chanda
 
Decision tree and random forest
Decision tree and random forestDecision tree and random forest
Decision tree and random forest
Lippo Group Digital
 
1.1 binary tree
1.1 binary tree1.1 binary tree
1.1 binary tree
Krish_ver2
 
FP-growth.pptx
FP-growth.pptxFP-growth.pptx
FP-growth.pptx
selvifitria1
 
Data preprocessing
Data preprocessingData preprocessing
Data preprocessing
ankur bhalla
 
Expression trees
Expression treesExpression trees
Expression trees
Salman Vadsarya
 
Apriori algorithm
Apriori algorithmApriori algorithm
Apriori algorithm
Ashis Kumar Chanda
 
Chapter 6. Mining Frequent Patterns, Associations and Correlations Basic Conc...
Chapter 6. Mining Frequent Patterns, Associations and Correlations Basic Conc...Chapter 6. Mining Frequent Patterns, Associations and Correlations Basic Conc...
Chapter 6. Mining Frequent Patterns, Associations and Correlations Basic Conc...
Subrata Kumer Paul
 
Structure of the page table
Structure of the page tableStructure of the page table
Structure of the page table
duvvuru madhuri
 
Apriori algorithm
Apriori algorithmApriori algorithm
Apriori algorithm
Mainul Hassan
 
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.
 
Data Mining: Concepts and Techniques — Chapter 2 —
Data Mining:  Concepts and Techniques — Chapter 2 —Data Mining:  Concepts and Techniques — Chapter 2 —
Data Mining: Concepts and Techniques — Chapter 2 —
Salah Amean
 
Classification and prediction in data mining
Classification and prediction in data miningClassification and prediction in data mining
Classification and prediction in data mining
Er. Nawaraj Bhandari
 
Association Analysis in Data Mining
Association Analysis in Data MiningAssociation Analysis in Data Mining
Association Analysis in Data Mining
Kamal Acharya
 
Association rules
Association rulesAssociation rules
Association rules
Dr. C.V. Suresh Babu
 
File organization and introduction of DBMS
File organization and introduction of DBMSFile organization and introduction of DBMS
File organization and introduction of DBMS
VrushaliSolanke
 
Pandas
PandasPandas
Pandas
maikroeder
 
Mining Frequent Patterns And Association Rules
Mining Frequent Patterns And Association RulesMining Frequent Patterns And Association Rules
Mining Frequent Patterns And Association Rules
Rashmi Bhat
 

What's hot (20)

Data Structure and Algorithms Binary Search Tree
Data Structure and Algorithms Binary Search TreeData Structure and Algorithms Binary Search Tree
Data Structure and Algorithms Binary Search Tree
 
Frequent Pattern Growth Algorithm (FP growth method)
Frequent Pattern Growth Algorithm (FP growth method)Frequent Pattern Growth Algorithm (FP growth method)
Frequent Pattern Growth Algorithm (FP growth method)
 
Frequent Pattern growth algorithm
Frequent Pattern growth algorithmFrequent Pattern growth algorithm
Frequent Pattern growth algorithm
 
Decision tree and random forest
Decision tree and random forestDecision tree and random forest
Decision tree and random forest
 
1.1 binary tree
1.1 binary tree1.1 binary tree
1.1 binary tree
 
FP-growth.pptx
FP-growth.pptxFP-growth.pptx
FP-growth.pptx
 
Data preprocessing
Data preprocessingData preprocessing
Data preprocessing
 
Expression trees
Expression treesExpression trees
Expression trees
 
Apriori algorithm
Apriori algorithmApriori algorithm
Apriori algorithm
 
Chapter 6. Mining Frequent Patterns, Associations and Correlations Basic Conc...
Chapter 6. Mining Frequent Patterns, Associations and Correlations Basic Conc...Chapter 6. Mining Frequent Patterns, Associations and Correlations Basic Conc...
Chapter 6. Mining Frequent Patterns, Associations and Correlations Basic Conc...
 
Structure of the page table
Structure of the page tableStructure of the page table
Structure of the page table
 
Apriori algorithm
Apriori algorithmApriori algorithm
Apriori algorithm
 
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
 
Data Mining: Concepts and Techniques — Chapter 2 —
Data Mining:  Concepts and Techniques — Chapter 2 —Data Mining:  Concepts and Techniques — Chapter 2 —
Data Mining: Concepts and Techniques — Chapter 2 —
 
Classification and prediction in data mining
Classification and prediction in data miningClassification and prediction in data mining
Classification and prediction in data mining
 
Association Analysis in Data Mining
Association Analysis in Data MiningAssociation Analysis in Data Mining
Association Analysis in Data Mining
 
Association rules
Association rulesAssociation rules
Association rules
 
File organization and introduction of DBMS
File organization and introduction of DBMSFile organization and introduction of DBMS
File organization and introduction of DBMS
 
Pandas
PandasPandas
Pandas
 
Mining Frequent Patterns And Association Rules
Mining Frequent Patterns And Association RulesMining Frequent Patterns And Association Rules
Mining Frequent Patterns And Association Rules
 

Recently uploaded

NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptxNEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
iammrhaywood
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
Priyankaranawat4
 
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptxChapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Denish Jangid
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
adhitya5119
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
eBook.com.bd (প্রয়োজনীয় বাংলা বই)
 
B. Ed Syllabus for babasaheb ambedkar education university.pdf
B. Ed Syllabus for babasaheb ambedkar education university.pdfB. Ed Syllabus for babasaheb ambedkar education university.pdf
B. Ed Syllabus for babasaheb ambedkar education university.pdf
BoudhayanBhattachari
 
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptxPrésentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
siemaillard
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Excellence Foundation for South Sudan
 
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPLAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
RAHUL
 
Constructing Your Course Container for Effective Communication
Constructing Your Course Container for Effective CommunicationConstructing Your Course Container for Effective Communication
Constructing Your Course Container for Effective Communication
Chevonnese Chevers Whyte, MBA, B.Sc.
 
Temple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation resultsTemple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation results
Krassimira Luka
 
IGCSE Biology Chapter 14- Reproduction in Plants.pdf
IGCSE Biology Chapter 14- Reproduction in Plants.pdfIGCSE Biology Chapter 14- Reproduction in Plants.pdf
IGCSE Biology Chapter 14- Reproduction in Plants.pdf
Amin Marwan
 
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
imrankhan141184
 
How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience
Wahiba Chair Training & Consulting
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
Nicholas Montgomery
 
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skillsspot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
haiqairshad
 
Leveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit InnovationLeveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit Innovation
TechSoup
 
UGC NET Exam Paper 1- Unit 1:Teaching Aptitude
UGC NET Exam Paper 1- Unit 1:Teaching AptitudeUGC NET Exam Paper 1- Unit 1:Teaching Aptitude
UGC NET Exam Paper 1- Unit 1:Teaching Aptitude
S. Raj Kumar
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
GeorgeMilliken2
 
How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
Celine George
 

Recently uploaded (20)

NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptxNEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
 
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptxChapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptx
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
 
B. Ed Syllabus for babasaheb ambedkar education university.pdf
B. Ed Syllabus for babasaheb ambedkar education university.pdfB. Ed Syllabus for babasaheb ambedkar education university.pdf
B. Ed Syllabus for babasaheb ambedkar education university.pdf
 
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptxPrésentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
 
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPLAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
 
Constructing Your Course Container for Effective Communication
Constructing Your Course Container for Effective CommunicationConstructing Your Course Container for Effective Communication
Constructing Your Course Container for Effective Communication
 
Temple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation resultsTemple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation results
 
IGCSE Biology Chapter 14- Reproduction in Plants.pdf
IGCSE Biology Chapter 14- Reproduction in Plants.pdfIGCSE Biology Chapter 14- Reproduction in Plants.pdf
IGCSE Biology Chapter 14- Reproduction in Plants.pdf
 
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
 
How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
 
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skillsspot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
 
Leveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit InnovationLeveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit Innovation
 
UGC NET Exam Paper 1- Unit 1:Teaching Aptitude
UGC NET Exam Paper 1- Unit 1:Teaching AptitudeUGC NET Exam Paper 1- Unit 1:Teaching Aptitude
UGC NET Exam Paper 1- Unit 1:Teaching Aptitude
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
 
How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
 

Fp growth algorithm

  • 1. DATA MINING AND WARE HOUSING (FP GROWTH ALGORITHM EXAMPLE) MADE BY: MANISH MESHRAM (203441006) GUIDED BY: DR.DIPALI MEHER SHREYA KALEKAR (203441009) SWATI BOTE (203441015) YASH CHITNIS (203441020) VINAY BHOSALE (203441027) MODERN COLLEGE OF ARTS, SCIENCE & COMMERCE, GANESHKHIND. DEPARTMENT: COMPUTER SCIENCE(M.Sc. I (CA))
  • 2. •FP Growth Algorithm (Frequent pattern growth). FP growth algorithm is an improvement of Apriori algorithm. FP growth algorithm used for finding frequent itemset in a transaction database without candidate generation. •FP growth represents frequent items in frequent pattern trees or FP-tree.
  • 3. Apply the FP tree algorithm for the given transactional database with the minimum support of 4. Transaction ID List of Items T1 Milk, Bread, Butter T2 Bread, Milk T3 Sugar, Milk, Bread T4 Bread, Butter T5 Bread, Butter, Milk T6 Milk, Sugar T7 Milk, Bread, Butter T8 Milk, Butter
  • 4. STEP 1: Find out the frequency of occurrence of each item in the database. ITEMS FREQUENC Y Milk 7 Bread 6 Butter 5 Sugar 2 Transaction ID List of Items T1 Milk, Bread, Butter T2 Bread, Milk T3 Sugar, Milk, Bread T4 Bread, Butter T5 Bread, Butter, Milk T6 Milk, Sugar Table2: Frequency of occurrence Table 1 Table 2
  • 5. STEP 2: Prioritize the item. Give the priority to each item according to its frequency of occurrence. ITEMS FREQUENCY Milk 7 Bread 6 Butter 5 Sugar 2 Table 2 ITEMS FREQUENCY Milk 7 Bread 6 Butter 5 Sugar 2 PRIORITY 1 2 3 4 Table 3
  • 6. STEP 3: Order the items according to the priorities in a tabular format. Transaction ID List of Items T1 Milk, Bread, Butter T2 Bread, Milk T3 Sugar, Milk, Bread T4 Bread, Butter T5 Bread, Butter, Milk T6 Milk, Sugar T7 Milk, Bread, Ordered Items Milk, Bread, Butter Milk, Bread Milk, Bread, Sugar Bread, Butter Milk, Bread, Butter Milk, Sugar Table 4 New version of Table 1 1 2 3 4
  • 7. STEP 4: Order the items according to priority in an FP Tree format. • Row 1: Lets take the items of row 1 (Milk: M, Bread: BR, Butter: B) and arrange them one by one respectively. All FP Tree have a “null” node and a “root” node. NUL L M:1 BR: 1 B:1
  • 8. CONTINUE UPDATING THE TREE • Row 2: Lets take the items of row 2(Milk: M, Bread: B). Continue updating the occurrence of the items. NULL M:2 BR: 2 B:1
  • 9. CONTINUE UPDATING THE TREE • Row 3: Lets take the items from the third row( Milk: M, Bread: BR, Sugar: S). Here new root node will be created which will connect ‘BR’ i.e., ‘S’. Update the occurrence of the items. NUL L M:3 BR: 3 B:1 S:1
  • 10. CONTINUE ADDING THE ITEMS FROM THE FORTH ROW • Row 4: Lets take the items from the forth row(Bread: BR, Butter: B). Here new root node will be generated from the null node. Write the occurrence of the items as well. NULL M:3 BR:3 B:1 S:1 BR: 1 B:1
  • 11. CONTINUE ADDING THE ITEMS IN THE TREE • Row 5: Lets add the items from the fifth row( Milk: M, Bread: BR, Butter: B ). It will continue with the previous node it self only the occurrence of the items will be changed. NUL L M:4 BR:4 B:2 S:1 BR:1 B:1
  • 12. CONTINUE ADDING THE ITEMS IN THE TREE • Row 6: Lets add the items from the sixth row( Milk: M, Sugar: S). Item Sugar will be added to the Milk node that means a new node will be generated. NUL L M:5 BR:4 B:2 S:1 S:1 BR:1 B:1
  • 13. KEEP ON ADDING THE ITEMS OF THE SEVENTH ROW • Row 7: Lets take the items of seventh row (Milk: M, Bread: BR, Butter: B). It will continue in the previous nodes itself. Only the occurrences will be increased. NULL M:6 BR:5 B:3 S:1 S:1 BR:1 B:1
  • 14. KEEP ON ADDING THE ITEMS OF THE LAST ROW • Row 8: Lets add the items from the eight row( Milk: M, Butter: B). Item Butter will be added to the Milk node that means a new node will be generated. NUL L M:7 BR:5 B:1 B:3 S:1 S:1 BR:1 B:1 FINAL FP TREE
  • 15. STEP 5: VALIDATION • To know whether the FP Tree is correct or not. • Check the count of frequency of occurrence of each item with the help of Table 2. • If the frequency of the both Table and Tree matches then the FP Tree is correct.
  • 16. COUNT THE FREQUENCY OF OOCURRENCE ITEMS FREQUENC Y Milk 7 Bread 6 Butter 5 Sugar 2 Table 2 NUL L M:7 B:1 BR:5 S:1 B:3 S:1 BR:1 B:1