SlideShare a Scribd company logo
1 of 10
Market Basket Analysis
STORE
You Have
Purchased
…
Recommend for you …
Market Basket Analysis
By
Swagath Ranjan Behra
Contents
• Data Science Objective
• About data
• EDA
• Data Preparation
• ML Approach
• Results
• Conclusion
Data Science Objective
• To understand the customer behaviour based on the previous purchase.
• To identify customers interest on specific product from various range of product
categories
• To construct a set of rules using Market Basket Analysis which will be helpful to increase
the sales.
• To identify a set of rules for decision making process to identify the frequent buyers of
products and the combination of the products. This will helpful to propose the customer
to buy the product based his previous purchase.
About Data
• The data has 44 columns and 29929 observations which represents order details,
customer details, shipping details, pricing details, item details, business unit, territory and
financial details.
• Columns are measured and available in both numeric and character formats.
• All columns are duly converted to needed formats namely., dates, binary responses,
nominal to numeric, etc.
• Found few columns with missing value percentage more than 50% have been excluded.
• Columns representing identification ones, Unique id are ignored for analysis.
• For market basket analysis customer number, order creation date, item description and
item number are relevant.
Exploratory Data Analysis
Product Purchased Together Count Product Purchased Together Count
One 9835 Seventeen 95
Two 7676 Eighteen 66
Three 6033 Nineteen 52
Four 4734 Twenty 38
Five 3729 Twenty One 29
Six 2874 Twenty Two 18
Seven 2229 Twenty Three 14
Eight 1684 Twenty Four 8
Nine 1246 Twenty Five 7
Ten 896 Twenty Six 7
Eleven 650 Twenty Seven 6
Twelve 468 Twenty Eight 5
Thirteen 351 Twenty Nine 4
Fourteen 273 Thirty 1
Fifteen 196 Thiry One 1
Sixteen 141 Thirty Two 1
• After
performing
necessary
cleaning, did a
basic EDA.
• Maximum
number of
products
purchased per
transaction in
the given data
equals 32.
• And a minimum
of one product
for every
transaction.
Data Preparation
• Consider last 3 years data as there might be the possibility that some products mayn’t be
continued.
• Then entries are selected from a specific date.
• The data is grouped based on the customer and date of creation of the order.
• The data should be arranged to get the distinct product purchased by each customer.
ML Approach
Apriori Association Rule Technique
have been implemented with
minimum bound support for each
rule at 0.001, and at least 0.5 (>
50%) confidence that customer
buys recommended product. Also
requested for output items sets as
rules, and minimum of ten rules as
output.
Model Output & Evaluation
1. X2_sausage=t 99 ==> X1_frankfurter=t 99 <conf:(1)>
2. X1_citrus fruit=t X3_pip fruit=t 31 ==> X2_tropical fruit=t 31 <conf:(1)>
3. X2_sausage=t X3_tropical fruit=t 10 ==> X1_frankfurter=t 10 <conf:(1)>
4. X1_other vegetables=t X3_curd=t 14 ==> X2_whole milk=t 13 <conf:(0.93)>
5. X1_root vegetables=t X3_whole milk=t 41 ==> X2_other vegetables=t 32 <conf:(0.78)>
6. X1_other vegetables=t X3_yogurt=t 33 ==> X2_whole milk=t 24 <conf:(0.73)>
7. X2_liquor=t 31 ==> X1_bottled beer=t 22 <conf:(0.71)>
8. X2_ham=t 64 ==> X1_sausage=t 43 <conf:(0.67)>
9. X1_sausage=t X3_soda=t 24 ==> X2_rolls/buns=t 16 <conf:(0.67)>
10. X3_liquor=t 27 ==> X2_bottled beer=t 17 <conf:(0.63)>
• Association rules are evaluated based on the measures available in the rule set.
• Each rule will be in the form of antecedent => consequent format.
• In addition, one can see each rule’s confidence number <conf: (x)>, which tells us about
support for that rule and we have minimum support of 0.63 which is nothing but a cut
off of 63% was used in selecting above 10 rules.
Conclusion
• Association Rules provide an efficient set of rules that recommend next best buy for the
visiting store customers.
• As we have seen in our research we found several such ones, similarities between the
items purchased like customers who ever buy other vegetables, and curd are more likely
to buy whole milk.
• Similarly, customers who buy citrus fruit, and pip fruit, are more likely to buy tropical fruit
for regular use.
• Thus, all these generated rule sets help retailer to recommend best possible buys for their
customers, where in without any external marketing effort.
Thank You

More Related Content

What's hot

Understanding Association Rule Mining
Understanding Association Rule MiningUnderstanding Association Rule Mining
Understanding Association Rule MiningMohit Rajput
 
Association rules by arpit_sharma
Association rules by arpit_sharmaAssociation rules by arpit_sharma
Association rules by arpit_sharmaEr. Arpit Sharma
 
RDataMining slides-association-rule-mining-with-r
RDataMining slides-association-rule-mining-with-rRDataMining slides-association-rule-mining-with-r
RDataMining slides-association-rule-mining-with-rYanchang Zhao
 
Profitable Itemset Mining using Weights
Profitable Itemset Mining using WeightsProfitable Itemset Mining using Weights
Profitable Itemset Mining using WeightsIRJET Journal
 
Case study on Transaction in Grocery Store
Case study on Transaction in Grocery Store Case study on Transaction in Grocery Store
Case study on Transaction in Grocery Store divyawani2
 

What's hot (7)

Understanding Association Rule Mining
Understanding Association Rule MiningUnderstanding Association Rule Mining
Understanding Association Rule Mining
 
Apriori Algorithm
Apriori AlgorithmApriori Algorithm
Apriori Algorithm
 
Association rules by arpit_sharma
Association rules by arpit_sharmaAssociation rules by arpit_sharma
Association rules by arpit_sharma
 
Rmining
RminingRmining
Rmining
 
RDataMining slides-association-rule-mining-with-r
RDataMining slides-association-rule-mining-with-rRDataMining slides-association-rule-mining-with-r
RDataMining slides-association-rule-mining-with-r
 
Profitable Itemset Mining using Weights
Profitable Itemset Mining using WeightsProfitable Itemset Mining using Weights
Profitable Itemset Mining using Weights
 
Case study on Transaction in Grocery Store
Case study on Transaction in Grocery Store Case study on Transaction in Grocery Store
Case study on Transaction in Grocery Store
 

Similar to Ml Market Basket Analysis

BI.004.03.Presentation.Coupon Redemption - Power to Predict Valued Shoppers
BI.004.03.Presentation.Coupon Redemption - Power to Predict Valued ShoppersBI.004.03.Presentation.Coupon Redemption - Power to Predict Valued Shoppers
BI.004.03.Presentation.Coupon Redemption - Power to Predict Valued ShoppersKuldeep Ahir
 
What is FP Growth Analysis and How Can a Business Use Frequent Pattern Mining...
What is FP Growth Analysis and How Can a Business Use Frequent Pattern Mining...What is FP Growth Analysis and How Can a Business Use Frequent Pattern Mining...
What is FP Growth Analysis and How Can a Business Use Frequent Pattern Mining...Smarten Augmented Analytics
 
MODULE 5 _ Mining frequent patterns and associations.pptx
MODULE 5 _ Mining frequent patterns and associations.pptxMODULE 5 _ Mining frequent patterns and associations.pptx
MODULE 5 _ Mining frequent patterns and associations.pptxnikshaikh786
 
Market Basket Analysis in SAS
Market Basket Analysis in SASMarket Basket Analysis in SAS
Market Basket Analysis in SASAndrew Kramer
 
big data seminar.pptx
big data seminar.pptxbig data seminar.pptx
big data seminar.pptxAmenahAbbood
 
Association 04.03.14
Association   04.03.14Association   04.03.14
Association 04.03.14rahulmath80
 
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 MiningWan Aezwani Wab
 
Understanding the Lifecycle of a Data Analysis Project
Understanding the Lifecycle of a Data Analysis ProjectUnderstanding the Lifecycle of a Data Analysis Project
Understanding the Lifecycle of a Data Analysis ProjectLevel Education
 
Market Basket Analysis.ppt
Market Basket Analysis.pptMarket Basket Analysis.ppt
Market Basket Analysis.pptUshaSeshadri1
 
Technology Update: Channel IQ Tech Innovation and Product Roadmap with CEO An...
Technology Update: Channel IQ Tech Innovation and Product Roadmap with CEO An...Technology Update: Channel IQ Tech Innovation and Product Roadmap with CEO An...
Technology Update: Channel IQ Tech Innovation and Product Roadmap with CEO An...Channel IQ
 
Demand forecasting
Demand forecastingDemand forecasting
Demand forecastingsuvarnapstpl
 
SAP Training in Noida
SAP Training in NoidaSAP Training in Noida
SAP Training in Noidasonendrapal
 
Group 2 inst. process_godrej_interio
Group 2 inst. process_godrej_interioGroup 2 inst. process_godrej_interio
Group 2 inst. process_godrej_interioSwarit Yadav
 
Masket Basket Analysis
Masket Basket AnalysisMasket Basket Analysis
Masket Basket AnalysisMarc Berman
 

Similar to Ml Market Basket Analysis (20)

BI.004.03.Presentation.Coupon Redemption - Power to Predict Valued Shoppers
BI.004.03.Presentation.Coupon Redemption - Power to Predict Valued ShoppersBI.004.03.Presentation.Coupon Redemption - Power to Predict Valued Shoppers
BI.004.03.Presentation.Coupon Redemption - Power to Predict Valued Shoppers
 
What is FP Growth Analysis and How Can a Business Use Frequent Pattern Mining...
What is FP Growth Analysis and How Can a Business Use Frequent Pattern Mining...What is FP Growth Analysis and How Can a Business Use Frequent Pattern Mining...
What is FP Growth Analysis and How Can a Business Use Frequent Pattern Mining...
 
MODULE 5 _ Mining frequent patterns and associations.pptx
MODULE 5 _ Mining frequent patterns and associations.pptxMODULE 5 _ Mining frequent patterns and associations.pptx
MODULE 5 _ Mining frequent patterns and associations.pptx
 
Bmgt 411 week3
Bmgt 411 week3Bmgt 411 week3
Bmgt 411 week3
 
Assignment 2 2
Assignment 2 2Assignment 2 2
Assignment 2 2
 
Market Basket Analysis in SAS
Market Basket Analysis in SASMarket Basket Analysis in SAS
Market Basket Analysis in SAS
 
big data seminar.pptx
big data seminar.pptxbig data seminar.pptx
big data seminar.pptx
 
Association 04.03.14
Association   04.03.14Association   04.03.14
Association 04.03.14
 
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
 
Sales Order Process.ppt
Sales Order Process.pptSales Order Process.ppt
Sales Order Process.ppt
 
Om ibs-2
Om ibs-2Om ibs-2
Om ibs-2
 
Association Analysis
Association AnalysisAssociation Analysis
Association Analysis
 
Association Analysis
Association AnalysisAssociation Analysis
Association Analysis
 
Understanding the Lifecycle of a Data Analysis Project
Understanding the Lifecycle of a Data Analysis ProjectUnderstanding the Lifecycle of a Data Analysis Project
Understanding the Lifecycle of a Data Analysis Project
 
Market Basket Analysis.ppt
Market Basket Analysis.pptMarket Basket Analysis.ppt
Market Basket Analysis.ppt
 
Technology Update: Channel IQ Tech Innovation and Product Roadmap with CEO An...
Technology Update: Channel IQ Tech Innovation and Product Roadmap with CEO An...Technology Update: Channel IQ Tech Innovation and Product Roadmap with CEO An...
Technology Update: Channel IQ Tech Innovation and Product Roadmap with CEO An...
 
Demand forecasting
Demand forecastingDemand forecasting
Demand forecasting
 
SAP Training in Noida
SAP Training in NoidaSAP Training in Noida
SAP Training in Noida
 
Group 2 inst. process_godrej_interio
Group 2 inst. process_godrej_interioGroup 2 inst. process_godrej_interio
Group 2 inst. process_godrej_interio
 
Masket Basket Analysis
Masket Basket AnalysisMasket Basket Analysis
Masket Basket Analysis
 

Recently uploaded

Grocery_ POS_ Billing _Software (1).pptx
Grocery_ POS_ Billing _Software (1).pptxGrocery_ POS_ Billing _Software (1).pptx
Grocery_ POS_ Billing _Software (1).pptxQueueBuster
 
5 Ways Sea Moss Can Improve Thyroid Function
5 Ways Sea Moss Can Improve Thyroid Function5 Ways Sea Moss Can Improve Thyroid Function
5 Ways Sea Moss Can Improve Thyroid FunctionJoy Ecc
 
Elo Cakes | Premium Cake Shop | Order Now
Elo Cakes | Premium Cake Shop | Order NowElo Cakes | Premium Cake Shop | Order Now
Elo Cakes | Premium Cake Shop | Order NowElo Cakes
 
Assessing the COOKING SKILLS Development of Grade 11 Cookery Students in Cari...
Assessing the COOKING SKILLS Development of Grade 11 Cookery Students in Cari...Assessing the COOKING SKILLS Development of Grade 11 Cookery Students in Cari...
Assessing the COOKING SKILLS Development of Grade 11 Cookery Students in Cari...GilbertObanil2
 
+27635951414 Magic Ring For Fame Money And Powers In Great Britain, United St...
+27635951414 Magic Ring For Fame Money And Powers In Great Britain, United St...+27635951414 Magic Ring For Fame Money And Powers In Great Britain, United St...
+27635951414 Magic Ring For Fame Money And Powers In Great Britain, United St...mukulukhalid2023
 
Medical Foods final.ppt (Regulatory Aspects of Food & Nutraceiticals)
Medical Foods final.ppt (Regulatory Aspects of Food & Nutraceiticals)Medical Foods final.ppt (Regulatory Aspects of Food & Nutraceiticals)
Medical Foods final.ppt (Regulatory Aspects of Food & Nutraceiticals)Lokesh Kothari
 
100^%)( FORDSBURG))(*((+27838792658))*))௹ )Abortion Pills for Sale in Benoni,...
100^%)( FORDSBURG))(*((+27838792658))*))௹ )Abortion Pills for Sale in Benoni,...100^%)( FORDSBURG))(*((+27838792658))*))௹ )Abortion Pills for Sale in Benoni,...
100^%)( FORDSBURG))(*((+27838792658))*))௹ )Abortion Pills for Sale in Benoni,...drjose256
 
NO1 Top Black Magic Expert Specialist In UK Black Magic Expert Specialist In ...
NO1 Top Black Magic Expert Specialist In UK Black Magic Expert Specialist In ...NO1 Top Black Magic Expert Specialist In UK Black Magic Expert Specialist In ...
NO1 Top Black Magic Expert Specialist In UK Black Magic Expert Specialist In ...Amil baba
 
FSSAI.ppt Food safety standards act in RAFN
FSSAI.ppt Food safety standards act in RAFNFSSAI.ppt Food safety standards act in RAFN
FSSAI.ppt Food safety standards act in RAFNLokesh Kothari
 
Story of the Origin of Some Foods in Bengal.docx
Story of the Origin of Some Foods in Bengal.docxStory of the Origin of Some Foods in Bengal.docx
Story of the Origin of Some Foods in Bengal.docxTapas Kumar Basu
 
Postharvest technology and manageent.ppt
Postharvest technology  and manageent.pptPostharvest technology  and manageent.ppt
Postharvest technology and manageent.pptnazmulhrt
 

Recently uploaded (12)

Chaine des Rotisseurs Gala Dinner Menu May 25 2024 Cambodia
Chaine des Rotisseurs Gala Dinner Menu May 25 2024 CambodiaChaine des Rotisseurs Gala Dinner Menu May 25 2024 Cambodia
Chaine des Rotisseurs Gala Dinner Menu May 25 2024 Cambodia
 
Grocery_ POS_ Billing _Software (1).pptx
Grocery_ POS_ Billing _Software (1).pptxGrocery_ POS_ Billing _Software (1).pptx
Grocery_ POS_ Billing _Software (1).pptx
 
5 Ways Sea Moss Can Improve Thyroid Function
5 Ways Sea Moss Can Improve Thyroid Function5 Ways Sea Moss Can Improve Thyroid Function
5 Ways Sea Moss Can Improve Thyroid Function
 
Elo Cakes | Premium Cake Shop | Order Now
Elo Cakes | Premium Cake Shop | Order NowElo Cakes | Premium Cake Shop | Order Now
Elo Cakes | Premium Cake Shop | Order Now
 
Assessing the COOKING SKILLS Development of Grade 11 Cookery Students in Cari...
Assessing the COOKING SKILLS Development of Grade 11 Cookery Students in Cari...Assessing the COOKING SKILLS Development of Grade 11 Cookery Students in Cari...
Assessing the COOKING SKILLS Development of Grade 11 Cookery Students in Cari...
 
+27635951414 Magic Ring For Fame Money And Powers In Great Britain, United St...
+27635951414 Magic Ring For Fame Money And Powers In Great Britain, United St...+27635951414 Magic Ring For Fame Money And Powers In Great Britain, United St...
+27635951414 Magic Ring For Fame Money And Powers In Great Britain, United St...
 
Medical Foods final.ppt (Regulatory Aspects of Food & Nutraceiticals)
Medical Foods final.ppt (Regulatory Aspects of Food & Nutraceiticals)Medical Foods final.ppt (Regulatory Aspects of Food & Nutraceiticals)
Medical Foods final.ppt (Regulatory Aspects of Food & Nutraceiticals)
 
100^%)( FORDSBURG))(*((+27838792658))*))௹ )Abortion Pills for Sale in Benoni,...
100^%)( FORDSBURG))(*((+27838792658))*))௹ )Abortion Pills for Sale in Benoni,...100^%)( FORDSBURG))(*((+27838792658))*))௹ )Abortion Pills for Sale in Benoni,...
100^%)( FORDSBURG))(*((+27838792658))*))௹ )Abortion Pills for Sale in Benoni,...
 
NO1 Top Black Magic Expert Specialist In UK Black Magic Expert Specialist In ...
NO1 Top Black Magic Expert Specialist In UK Black Magic Expert Specialist In ...NO1 Top Black Magic Expert Specialist In UK Black Magic Expert Specialist In ...
NO1 Top Black Magic Expert Specialist In UK Black Magic Expert Specialist In ...
 
FSSAI.ppt Food safety standards act in RAFN
FSSAI.ppt Food safety standards act in RAFNFSSAI.ppt Food safety standards act in RAFN
FSSAI.ppt Food safety standards act in RAFN
 
Story of the Origin of Some Foods in Bengal.docx
Story of the Origin of Some Foods in Bengal.docxStory of the Origin of Some Foods in Bengal.docx
Story of the Origin of Some Foods in Bengal.docx
 
Postharvest technology and manageent.ppt
Postharvest technology  and manageent.pptPostharvest technology  and manageent.ppt
Postharvest technology and manageent.ppt
 

Ml Market Basket Analysis

  • 1. Market Basket Analysis STORE You Have Purchased … Recommend for you … Market Basket Analysis By Swagath Ranjan Behra
  • 2. Contents • Data Science Objective • About data • EDA • Data Preparation • ML Approach • Results • Conclusion
  • 3. Data Science Objective • To understand the customer behaviour based on the previous purchase. • To identify customers interest on specific product from various range of product categories • To construct a set of rules using Market Basket Analysis which will be helpful to increase the sales. • To identify a set of rules for decision making process to identify the frequent buyers of products and the combination of the products. This will helpful to propose the customer to buy the product based his previous purchase.
  • 4. About Data • The data has 44 columns and 29929 observations which represents order details, customer details, shipping details, pricing details, item details, business unit, territory and financial details. • Columns are measured and available in both numeric and character formats. • All columns are duly converted to needed formats namely., dates, binary responses, nominal to numeric, etc. • Found few columns with missing value percentage more than 50% have been excluded. • Columns representing identification ones, Unique id are ignored for analysis. • For market basket analysis customer number, order creation date, item description and item number are relevant.
  • 5. Exploratory Data Analysis Product Purchased Together Count Product Purchased Together Count One 9835 Seventeen 95 Two 7676 Eighteen 66 Three 6033 Nineteen 52 Four 4734 Twenty 38 Five 3729 Twenty One 29 Six 2874 Twenty Two 18 Seven 2229 Twenty Three 14 Eight 1684 Twenty Four 8 Nine 1246 Twenty Five 7 Ten 896 Twenty Six 7 Eleven 650 Twenty Seven 6 Twelve 468 Twenty Eight 5 Thirteen 351 Twenty Nine 4 Fourteen 273 Thirty 1 Fifteen 196 Thiry One 1 Sixteen 141 Thirty Two 1 • After performing necessary cleaning, did a basic EDA. • Maximum number of products purchased per transaction in the given data equals 32. • And a minimum of one product for every transaction.
  • 6. Data Preparation • Consider last 3 years data as there might be the possibility that some products mayn’t be continued. • Then entries are selected from a specific date. • The data is grouped based on the customer and date of creation of the order. • The data should be arranged to get the distinct product purchased by each customer.
  • 7. ML Approach Apriori Association Rule Technique have been implemented with minimum bound support for each rule at 0.001, and at least 0.5 (> 50%) confidence that customer buys recommended product. Also requested for output items sets as rules, and minimum of ten rules as output.
  • 8. Model Output & Evaluation 1. X2_sausage=t 99 ==> X1_frankfurter=t 99 <conf:(1)> 2. X1_citrus fruit=t X3_pip fruit=t 31 ==> X2_tropical fruit=t 31 <conf:(1)> 3. X2_sausage=t X3_tropical fruit=t 10 ==> X1_frankfurter=t 10 <conf:(1)> 4. X1_other vegetables=t X3_curd=t 14 ==> X2_whole milk=t 13 <conf:(0.93)> 5. X1_root vegetables=t X3_whole milk=t 41 ==> X2_other vegetables=t 32 <conf:(0.78)> 6. X1_other vegetables=t X3_yogurt=t 33 ==> X2_whole milk=t 24 <conf:(0.73)> 7. X2_liquor=t 31 ==> X1_bottled beer=t 22 <conf:(0.71)> 8. X2_ham=t 64 ==> X1_sausage=t 43 <conf:(0.67)> 9. X1_sausage=t X3_soda=t 24 ==> X2_rolls/buns=t 16 <conf:(0.67)> 10. X3_liquor=t 27 ==> X2_bottled beer=t 17 <conf:(0.63)> • Association rules are evaluated based on the measures available in the rule set. • Each rule will be in the form of antecedent => consequent format. • In addition, one can see each rule’s confidence number <conf: (x)>, which tells us about support for that rule and we have minimum support of 0.63 which is nothing but a cut off of 63% was used in selecting above 10 rules.
  • 9. Conclusion • Association Rules provide an efficient set of rules that recommend next best buy for the visiting store customers. • As we have seen in our research we found several such ones, similarities between the items purchased like customers who ever buy other vegetables, and curd are more likely to buy whole milk. • Similarly, customers who buy citrus fruit, and pip fruit, are more likely to buy tropical fruit for regular use. • Thus, all these generated rule sets help retailer to recommend best possible buys for their customers, where in without any external marketing effort.