SlideShare a Scribd company logo
1 of 33
Download to read offline
© 2013 ExcelR Solutions. All Rights Reserved
Market
Basket
Analysis
Affinity
Analysis
Relationship
Mining
Association Rules
© 2013 ExcelR Solutions. All Rights Reserved
Market Basket Analysis
• Large number of transaction records through data collected using bar-code scanners
• Each record = All items purchased on a single purchase transaction
© 2013 ExcelR Solutions. All Rights Reserved
Association Rules
• What item goes with what
• Are certain groups of items consistently purchased together
• What business strategies will you device with this knowledge
© 2013 ExcelR Solutions. All Rights Reserved
Association Rules
• Products shelf placement – a specific product beside another
• Selling of prominent shelves – Slotting Fees
• Stocking – Supply Chain Management
• Price Bundling – Combo offers. How?
Source: http://www.economist.com/news/business/21654601-supplier-rebates-are-heart-some-supermarket-chains-woes-buying-up-shelves
https://en.wikipedia.org/wiki/Association_rule_learning
© 2013 ExcelR Solutions. All Rights Reserved
Association Rules – Cell phone faceplates
 A store sells accessories for cellular
phones runs a promotion on
faceplates
OFFER!
Buy multiple faceplates from a choice of
6 different colors & get discount
 How would you help store managers
device strategy to become more
profitable
© 2013 ExcelR Solutions. All Rights Reserved
Association Rules – Cell phone faceplates
Transaction # Faceplate colors purchased Transaction # Red White Blue Orange Green Yellow
1 Red White Green 1 1 1 0 0 1 0
2 White Orange 2 0 1 0 1 0 0
3 White Blue 3 0 1 1 0 0 0
4 Red White Orange 4 1 1 0 1 0 0
5 Red Blue 5 1 0 1 0 0 0
6 White Blue 6 0 1 1 0 0 0
7 White Orange 7 0 1 0 1 0 0
8 Red White Blue Green 8 1 1 1 0 1 0
9 Red White Blue 9 1 1 1 0 0 0
10 Yellow 10 0 0 0 0 0 1
List Format Binary Matrix Format
Association Rules are probabilistic “if-then” statements
2 Main Ideas:
 Examine all possible “if-then” rule formats
 Select rules, which indicates true dependence
© 2013 ExcelR Solutions. All Rights Reserved
Association Rules – Cell phone faceplates
Rules for { Red, White, Green}
1. If {Red, White} then {Green}
2. If {Red, Green} then {White}
3. If {White, Green} then {Red}
4. If {Red} then {White, Green}
5. If {White} then {Red, Green}
6. If {Green} then {Red, White}
Problem
• Many rules are possible
• How to select the
TRUE/GOOD rules from
all generated rules?
© 2013 ExcelR Solutions. All Rights Reserved
Association Rules – Terminology
• If {Red, White} then {Green}
• If Red & White phone faceplates are purchased, then Green
faceplate is purchased
 Antecedent: Red & White
 Consequent: Green
“IF” part = Antecedent = A
“THEN” part = Consequent = C
© 2013 ExcelR Solutions. All Rights Reserved
Association Rules – Performance Measures
Support
1
Confidence Lift
2 3
© 2013 ExcelR Solutions. All Rights Reserved
Association Rules – Support
Support
1
• Consider only combinations that occur with
higher frequency in the database
• Support is the criterion based on frequency
Percentage / Number of transactions in which
IF/Antecedent & THEN / Consequent appear in
the data
Mathematically:
# transactions in which A & C appear together
_____________________________________
Total no. of transactions
© 2013 ExcelR Solutions. All Rights Reserved
Support - Calculation
• What is the support for
“if White then Blue”?
1. 4
2. 40%
3. 2
4. 90%
Transaction # Faceplate colors purchased
1 Red White Green
2 White Orange
3 White Blue
4 Red White Orange
5 Red Blue
6 White Blue
7 White Orange
8 Red White Blue Green
9 Red White Blue
10 Yellow
• What is the support for
“if Blue then White”?
1. 4
2. 40%
3. 2
4. 90%
© 2013 ExcelR Solutions. All Rights Reserved
Support - Problem
• Generating all possible rules is exponential in the
number of distinct items
• Solution:
Frequent item sets using Apriori Algorithm
© 2013 ExcelR Solutions. All Rights Reserved
Apriori Algorithm For k products:
1
2
3
4
5
Set minimum support criteria
Generate list of one-item sets that meet the support
criterion
Use list of one-item sets to generate list of two-item sets
that meet support criterion
Use list of two-item sets to generate list of three-item sets
that meet support criterion
Continue up through k-item sets
© 2013 ExcelR Solutions. All Rights Reserved
Support – Criterion = 2
Transaction # Faceplate colors purchased
1 Red White Green
2 White Orange
3 White Blue
4 Red White Orange
5 Red Blue
6 White Blue
7 White Orange
8 Red White Blue Green
9 Red White Blue
10 Yellow
Item set Support (Count)
{Red} 5
{White} 8
{Blue} 5
{Orange} 3
{Green} 2
{Red, White} 4
{Red, Blue} 3
{Red, Green} 2
{White, Blue} 4
{White, Orange} 3
{White, Green} 2
{Red, White, Blue} 2
{Red, White, Green} 2
Create rules from
frequent item sets only
© 2013 ExcelR Solutions. All Rights Reserved
Support Criterion Example
Rules for { Red, White, Green}
1. If {Red, White} then {Green}
2. If {Red, Green} then {White}
3. If {White, Green} then {Red}
4. If {Red} then {White, Green}
5. If {White} then {Red, Green}
6. If {Green} then {Red, White}
How good are these
rules beyond the point
that they have high
support?
© 2013 ExcelR Solutions. All Rights Reserved
Association Rules – Confidence
Confidence
2
• Percentage of If/Antecedent transactions that
also have the Then/Consequent item set
Mathematically:
P (Consequent | Antecedent) = P(C & A) / P(A)
# transactions in which A & C appear together
_____________________________________
# transactions with A
© 2013 ExcelR Solutions. All Rights Reserved
Confidence - Calculation
• What is the confidence
for “if White then Blue”?
1. 4/5
2. 5/8
3. 5/4
4. 4/8
Transaction # Faceplate colors purchased
1 Red White Green
2 White Orange
3 White Blue
4 Red White Orange
5 Red Blue
6 White Blue
7 White Orange
8 Red White Blue Green
9 Red White Blue
10 Yellow
• What is the confidence
for “if Blue then White”?
1. 4/5
2. 5/8
3. 5/4
4. 4/8
© 2013 ExcelR Solutions. All Rights Reserved
Confidence - Weakness
• If antecedent and consequent have:
High Support => High / Biased Confidence
© 2013 ExcelR Solutions. All Rights Reserved
Association Rules – Lift Ratio
Lift Ratio
3
Confidence / Benchmark
confidence
Benchmark assumes independence between
antecedent & consequent:
P(antecedent & consequent) = P(antecedent) X P(consequent)
Benchmark confidence
P(C|A) = P(C & A) / P(A) = P(C) X P(A) /P(A) = P(C)
# transactions with consequent item sets
_____________________________________
# transactions in database
© 2013 ExcelR Solutions. All Rights Reserved
Interpreting Lift
• Lift > 1 indicates a rule that is useful in finding consequent item
sets
• The rule above is much better than selecting random transactions
© 2013 ExcelR Solutions. All Rights Reserved
Lift - Calculation
• What is the Lift for “if White then Blue”?
1. 4/8
2. 5/10
3. 4/5
4. 1
Transaction # Faceplate colors purchased
1 Red White Green
2 White Orange
3 White Blue
4 Red White Orange
5 Red Blue
6 White Blue
7 White Orange
8 Red White Blue Green
9 Red White Blue
10 Yellow
© 2013 ExcelR Solutions. All Rights Reserved
Rules selection process
Generate all rules that meet
specified Support & Confidence
 Find frequent item sets based on
Support specified by applying
minimum support cutoff
 From these item sets, generate rules
with defined Confidence. By filtering
remaining rules select only those with
high Confidence
© 2013 ExcelR Solutions. All Rights Reserved
Rules
Inputs Data
# Transactions in Input Data 10
# Columns in Input Data 6
# Items in Input Data 6
# Association Rules 8
Minimum Support 2
Minimum Confidence 70.00%
List of
Rules
Rule: If all Antecedent items are purchased, then with Confidence percentage Consequent items will also be
purchased.
Row ID Confidence %
Antecedent
(A)
Consequent
(C)
Support for
A
Support for
C
Support for
A & C
Lift
Ratio
8 100 green red & white 2 4 2 2.5
4 100 green red 2 5 2 2
6 100 white & green red 2 5 2 2
3 100 orange white 3 8 3 1.25
5 100 green white 2 8 2 1.25
7 100 red & green white 2 8 2 1.25
1 80 red white 5 8 4 1
2 80 blue white 5 8 4 1
© 2013 ExcelR Solutions. All Rights Reserved
Alarming!
 Random data can generate apparently
interesting association rules
 More the rules you produce, greater the
danger
 Rules based on large numbers of records
are less subject to this danger
© 2013 ExcelR Solutions. All Rights Reserved
Profusion of rules
© 2013 ExcelR Solutions. All Rights Reserved
Applications
• What if Product & Stores are selected as a tuple for analysis?
• What if crimes in different
geographies for each week
is known?
Narcotics
Robbery
AssaultBattery Narcotics
Public
Peace
Violation
© 2013 ExcelR Solutions. All Rights Reserved
Recap with an example
• How can you use the information if you know about the
purchase history of customers in a specific geography?
• Supermarket database has 100,000 POS transactions
• 2000 transactions include both Strepsils & Orange Juice
• 800 of the above 2000 include Soup purchases
© 2013 ExcelR Solutions. All Rights Reserved
Recap with an example
• What is the support for rule “IF (Orange Juice & Strepsils) are purchased
THEN (Soup) is purchased on the same trip”?
1. 0.8 %
2. 2 %
3. 40 %
• What is the confidence for rule “IF (Orange Juice & Strepsils) are purchased
THEN (Soup) is purchased on the same trip”?
1. 0.8 %
2. 2 %
3. 40 %
© 2013 ExcelR Solutions. All Rights Reserved
Recap with an example
• What is the lift ratio for rule “IF (Orange Juice & Strepsils) are purchased
THEN (Soup) is purchased on the same trip”?
© 2013 ExcelR Solutions. All Rights Reserved
Sequential Pattern Mining
Purchases / events occur at
the same time
• If person X has taken “Data
Mining Unsupervised” training
in 1st Quarter, Person X has
also taken “Data Mining
Supervised” training in 2nd
Quarter
• Based on the statement
above, recommend “Data
Mining Supervised” training to
those who have enrolled for
“Data Mining Unsupervised”
NOT
IT IS
© 2013 ExcelR Solutions. All Rights Reserved
Association Rules vs. Sequential Pattern Mining
• Look for temporal patterns
• Order/sequence of a & b matters for a rule “b follows a”
• However, what happens in between a & b doesn’t matter
• In phone faceplates dataset:
 Association among items, which were bought within the
same week were discovered
 How about finding what they would buy next week or the
week after, if they had bought ‘x’ in this week?
© 2013 ExcelR Solutions. All Rights Reserved
Applications
• Identify the appropriate Basket
• Identify popular taxi routes
 Sequential pattern from GPS tracks;
spatiotemporal records of taxi
trajectories
 First cluster collocated customers
© 2013 ExcelR Solutions. All Rights Reserved
THANK YOU

More Related Content

Similar to Data science training in hyderabad

2023 Supervised_Learning_Association_Rules
2023 Supervised_Learning_Association_Rules2023 Supervised_Learning_Association_Rules
2023 Supervised_Learning_Association_RulesFEG
 
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
 
6. Association Rule.pdf
6. Association Rule.pdf6. Association Rule.pdf
6. Association Rule.pdfJyoti Yadav
 
Using CART For Beginners with A Teclo Example Dataset
Using CART For Beginners with A Teclo Example DatasetUsing CART For Beginners with A Teclo Example Dataset
Using CART For Beginners with A Teclo Example DatasetSalford Systems
 
Products Frequently Bought Together in Stores Using classificat...
Products Frequently Bought Together in Stores               Using classificat...Products Frequently Bought Together in Stores               Using classificat...
Products Frequently Bought Together in Stores Using classificat...hibaziyad99
 
Intelligent Supermarket using Apriori
Intelligent Supermarket using AprioriIntelligent Supermarket using Apriori
Intelligent Supermarket using AprioriIRJET Journal
 
Business Reasons for Predictive Applications
Business Reasons for Predictive ApplicationsBusiness Reasons for Predictive Applications
Business Reasons for Predictive ApplicationsLars Trieloff
 
Why Predictive Analytics Should Be Part of Your 2015 Strategy Final
Why Predictive Analytics Should Be Part of Your 2015 Strategy FinalWhy Predictive Analytics Should Be Part of Your 2015 Strategy Final
Why Predictive Analytics Should Be Part of Your 2015 Strategy FinalJoe Brandenburg
 
SAS Analytics2011 Retail final LI Post
SAS Analytics2011 Retail final LI PostSAS Analytics2011 Retail final LI Post
SAS Analytics2011 Retail final LI PostEmmett Cox
 
EMI & Traceability – Maintaining Quality, Safety and Compliance
EMI & Traceability – Maintaining Quality, Safety and ComplianceEMI & Traceability – Maintaining Quality, Safety and Compliance
EMI & Traceability – Maintaining Quality, Safety and ComplianceNorthwest Analytics
 
Mind The Gap - Refinements to DMN 1.1 Suggested by Real-World Experience
Mind The Gap - Refinements to DMN 1.1 Suggested by Real-World ExperienceMind The Gap - Refinements to DMN 1.1 Suggested by Real-World Experience
Mind The Gap - Refinements to DMN 1.1 Suggested by Real-World ExperienceDecision Management Solutions
 
Smartcon 2015 – Automated Decisions in the Supply Chain
Smartcon 2015 – Automated Decisions in the Supply ChainSmartcon 2015 – Automated Decisions in the Supply Chain
Smartcon 2015 – Automated Decisions in the Supply ChainLars Trieloff
 
Association and Classification Algorithm
Association and Classification AlgorithmAssociation and Classification Algorithm
Association and Classification AlgorithmMedicaps University
 
EMC GLOBAL DATA PROTECTION INDEX
EMC GLOBAL DATA PROTECTION INDEX EMC GLOBAL DATA PROTECTION INDEX
EMC GLOBAL DATA PROTECTION INDEX EMC
 

Similar to Data science training in hyderabad (20)

2023 Supervised_Learning_Association_Rules
2023 Supervised_Learning_Association_Rules2023 Supervised_Learning_Association_Rules
2023 Supervised_Learning_Association_Rules
 
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
 
6. Association Rule.pdf
6. Association Rule.pdf6. Association Rule.pdf
6. Association Rule.pdf
 
Using CART For Beginners with A Teclo Example Dataset
Using CART For Beginners with A Teclo Example DatasetUsing CART For Beginners with A Teclo Example Dataset
Using CART For Beginners with A Teclo Example Dataset
 
Apriori algorithm
Apriori algorithmApriori algorithm
Apriori algorithm
 
Machine Learning For Stock Broking
Machine Learning For Stock BrokingMachine Learning For Stock Broking
Machine Learning For Stock Broking
 
Products Frequently Bought Together in Stores Using classificat...
Products Frequently Bought Together in Stores               Using classificat...Products Frequently Bought Together in Stores               Using classificat...
Products Frequently Bought Together in Stores Using classificat...
 
Big Data – Are You Ready?
Big Data – Are You Ready?Big Data – Are You Ready?
Big Data – Are You Ready?
 
Intelligent Supermarket using Apriori
Intelligent Supermarket using AprioriIntelligent Supermarket using Apriori
Intelligent Supermarket using Apriori
 
Business Reasons for Predictive Applications
Business Reasons for Predictive ApplicationsBusiness Reasons for Predictive Applications
Business Reasons for Predictive Applications
 
Why Predictive Analytics Should Be Part of Your 2015 Strategy Final
Why Predictive Analytics Should Be Part of Your 2015 Strategy FinalWhy Predictive Analytics Should Be Part of Your 2015 Strategy Final
Why Predictive Analytics Should Be Part of Your 2015 Strategy Final
 
SAS Analytics2011 Retail final LI Post
SAS Analytics2011 Retail final LI PostSAS Analytics2011 Retail final LI Post
SAS Analytics2011 Retail final LI Post
 
Machine Learning in Healthcare: A Case Study
Machine Learning in Healthcare: A Case StudyMachine Learning in Healthcare: A Case Study
Machine Learning in Healthcare: A Case Study
 
EMI & Traceability – Maintaining Quality, Safety and Compliance
EMI & Traceability – Maintaining Quality, Safety and ComplianceEMI & Traceability – Maintaining Quality, Safety and Compliance
EMI & Traceability – Maintaining Quality, Safety and Compliance
 
Mind The Gap - Refinements to DMN 1.1 Suggested by Real-World Experience
Mind The Gap - Refinements to DMN 1.1 Suggested by Real-World ExperienceMind The Gap - Refinements to DMN 1.1 Suggested by Real-World Experience
Mind The Gap - Refinements to DMN 1.1 Suggested by Real-World Experience
 
Smartcon 2015 – Automated Decisions in the Supply Chain
Smartcon 2015 – Automated Decisions in the Supply ChainSmartcon 2015 – Automated Decisions in the Supply Chain
Smartcon 2015 – Automated Decisions in the Supply Chain
 
Association
AssociationAssociation
Association
 
1705 keynote abbott
1705 keynote abbott1705 keynote abbott
1705 keynote abbott
 
Association and Classification Algorithm
Association and Classification AlgorithmAssociation and Classification Algorithm
Association and Classification Algorithm
 
EMC GLOBAL DATA PROTECTION INDEX
EMC GLOBAL DATA PROTECTION INDEX EMC GLOBAL DATA PROTECTION INDEX
EMC GLOBAL DATA PROTECTION INDEX
 

More from sushmapetloju

Analytics certification course in hyderabad.pdf
Analytics certification course in hyderabad.pdfAnalytics certification course in hyderabad.pdf
Analytics certification course in hyderabad.pdfsushmapetloju
 
Data science courses in hyderabad.pdf
Data science courses in hyderabad.pdfData science courses in hyderabad.pdf
Data science courses in hyderabad.pdfsushmapetloju
 
Data science certification training in hyderabad
Data science certification training in hyderabadData science certification training in hyderabad
Data science certification training in hyderabadsushmapetloju
 
Data science training in mumbai
Data science training in mumbaiData science training in mumbai
Data science training in mumbaisushmapetloju
 
Data science training in mumbai
Data science training in mumbaiData science training in mumbai
Data science training in mumbaisushmapetloju
 
Data science training in hyderabad
Data science training in hyderabadData science training in hyderabad
Data science training in hyderabadsushmapetloju
 
Data analytices training in bangalore
Data analytices training in bangaloreData analytices training in bangalore
Data analytices training in bangaloresushmapetloju
 

More from sushmapetloju (7)

Analytics certification course in hyderabad.pdf
Analytics certification course in hyderabad.pdfAnalytics certification course in hyderabad.pdf
Analytics certification course in hyderabad.pdf
 
Data science courses in hyderabad.pdf
Data science courses in hyderabad.pdfData science courses in hyderabad.pdf
Data science courses in hyderabad.pdf
 
Data science certification training in hyderabad
Data science certification training in hyderabadData science certification training in hyderabad
Data science certification training in hyderabad
 
Data science training in mumbai
Data science training in mumbaiData science training in mumbai
Data science training in mumbai
 
Data science training in mumbai
Data science training in mumbaiData science training in mumbai
Data science training in mumbai
 
Data science training in hyderabad
Data science training in hyderabadData science training in hyderabad
Data science training in hyderabad
 
Data analytices training in bangalore
Data analytices training in bangaloreData analytices training in bangalore
Data analytices training in bangalore
 

Recently uploaded

Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxPooja Bhuva
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the ClassroomPooky Knightsmith
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...Nguyen Thanh Tu Collection
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Pooja Bhuva
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfDr Vijay Vishwakarma
 
Philosophy of china and it's charactistics
Philosophy of china and it's charactisticsPhilosophy of china and it's charactistics
Philosophy of china and it's charactisticshameyhk98
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsSandeep D Chaudhary
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxDr. Ravikiran H M Gowda
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
Basic Intentional Injuries Health Education
Basic Intentional Injuries Health EducationBasic Intentional Injuries Health Education
Basic Intentional Injuries Health EducationNeilDeclaro1
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxPooja Bhuva
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 

Recently uploaded (20)

Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
Philosophy of china and it's charactistics
Philosophy of china and it's charactisticsPhilosophy of china and it's charactistics
Philosophy of china and it's charactistics
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & Systems
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Basic Intentional Injuries Health Education
Basic Intentional Injuries Health EducationBasic Intentional Injuries Health Education
Basic Intentional Injuries Health Education
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 

Data science training in hyderabad

  • 1. © 2013 ExcelR Solutions. All Rights Reserved Market Basket Analysis Affinity Analysis Relationship Mining Association Rules
  • 2. © 2013 ExcelR Solutions. All Rights Reserved Market Basket Analysis • Large number of transaction records through data collected using bar-code scanners • Each record = All items purchased on a single purchase transaction
  • 3. © 2013 ExcelR Solutions. All Rights Reserved Association Rules • What item goes with what • Are certain groups of items consistently purchased together • What business strategies will you device with this knowledge
  • 4. © 2013 ExcelR Solutions. All Rights Reserved Association Rules • Products shelf placement – a specific product beside another • Selling of prominent shelves – Slotting Fees • Stocking – Supply Chain Management • Price Bundling – Combo offers. How? Source: http://www.economist.com/news/business/21654601-supplier-rebates-are-heart-some-supermarket-chains-woes-buying-up-shelves https://en.wikipedia.org/wiki/Association_rule_learning
  • 5. © 2013 ExcelR Solutions. All Rights Reserved Association Rules – Cell phone faceplates  A store sells accessories for cellular phones runs a promotion on faceplates OFFER! Buy multiple faceplates from a choice of 6 different colors & get discount  How would you help store managers device strategy to become more profitable
  • 6. © 2013 ExcelR Solutions. All Rights Reserved Association Rules – Cell phone faceplates Transaction # Faceplate colors purchased Transaction # Red White Blue Orange Green Yellow 1 Red White Green 1 1 1 0 0 1 0 2 White Orange 2 0 1 0 1 0 0 3 White Blue 3 0 1 1 0 0 0 4 Red White Orange 4 1 1 0 1 0 0 5 Red Blue 5 1 0 1 0 0 0 6 White Blue 6 0 1 1 0 0 0 7 White Orange 7 0 1 0 1 0 0 8 Red White Blue Green 8 1 1 1 0 1 0 9 Red White Blue 9 1 1 1 0 0 0 10 Yellow 10 0 0 0 0 0 1 List Format Binary Matrix Format Association Rules are probabilistic “if-then” statements 2 Main Ideas:  Examine all possible “if-then” rule formats  Select rules, which indicates true dependence
  • 7. © 2013 ExcelR Solutions. All Rights Reserved Association Rules – Cell phone faceplates Rules for { Red, White, Green} 1. If {Red, White} then {Green} 2. If {Red, Green} then {White} 3. If {White, Green} then {Red} 4. If {Red} then {White, Green} 5. If {White} then {Red, Green} 6. If {Green} then {Red, White} Problem • Many rules are possible • How to select the TRUE/GOOD rules from all generated rules?
  • 8. © 2013 ExcelR Solutions. All Rights Reserved Association Rules – Terminology • If {Red, White} then {Green} • If Red & White phone faceplates are purchased, then Green faceplate is purchased  Antecedent: Red & White  Consequent: Green “IF” part = Antecedent = A “THEN” part = Consequent = C
  • 9. © 2013 ExcelR Solutions. All Rights Reserved Association Rules – Performance Measures Support 1 Confidence Lift 2 3
  • 10. © 2013 ExcelR Solutions. All Rights Reserved Association Rules – Support Support 1 • Consider only combinations that occur with higher frequency in the database • Support is the criterion based on frequency Percentage / Number of transactions in which IF/Antecedent & THEN / Consequent appear in the data Mathematically: # transactions in which A & C appear together _____________________________________ Total no. of transactions
  • 11. © 2013 ExcelR Solutions. All Rights Reserved Support - Calculation • What is the support for “if White then Blue”? 1. 4 2. 40% 3. 2 4. 90% Transaction # Faceplate colors purchased 1 Red White Green 2 White Orange 3 White Blue 4 Red White Orange 5 Red Blue 6 White Blue 7 White Orange 8 Red White Blue Green 9 Red White Blue 10 Yellow • What is the support for “if Blue then White”? 1. 4 2. 40% 3. 2 4. 90%
  • 12. © 2013 ExcelR Solutions. All Rights Reserved Support - Problem • Generating all possible rules is exponential in the number of distinct items • Solution: Frequent item sets using Apriori Algorithm
  • 13. © 2013 ExcelR Solutions. All Rights Reserved Apriori Algorithm For k products: 1 2 3 4 5 Set minimum support criteria Generate list of one-item sets that meet the support criterion Use list of one-item sets to generate list of two-item sets that meet support criterion Use list of two-item sets to generate list of three-item sets that meet support criterion Continue up through k-item sets
  • 14. © 2013 ExcelR Solutions. All Rights Reserved Support – Criterion = 2 Transaction # Faceplate colors purchased 1 Red White Green 2 White Orange 3 White Blue 4 Red White Orange 5 Red Blue 6 White Blue 7 White Orange 8 Red White Blue Green 9 Red White Blue 10 Yellow Item set Support (Count) {Red} 5 {White} 8 {Blue} 5 {Orange} 3 {Green} 2 {Red, White} 4 {Red, Blue} 3 {Red, Green} 2 {White, Blue} 4 {White, Orange} 3 {White, Green} 2 {Red, White, Blue} 2 {Red, White, Green} 2 Create rules from frequent item sets only
  • 15. © 2013 ExcelR Solutions. All Rights Reserved Support Criterion Example Rules for { Red, White, Green} 1. If {Red, White} then {Green} 2. If {Red, Green} then {White} 3. If {White, Green} then {Red} 4. If {Red} then {White, Green} 5. If {White} then {Red, Green} 6. If {Green} then {Red, White} How good are these rules beyond the point that they have high support?
  • 16. © 2013 ExcelR Solutions. All Rights Reserved Association Rules – Confidence Confidence 2 • Percentage of If/Antecedent transactions that also have the Then/Consequent item set Mathematically: P (Consequent | Antecedent) = P(C & A) / P(A) # transactions in which A & C appear together _____________________________________ # transactions with A
  • 17. © 2013 ExcelR Solutions. All Rights Reserved Confidence - Calculation • What is the confidence for “if White then Blue”? 1. 4/5 2. 5/8 3. 5/4 4. 4/8 Transaction # Faceplate colors purchased 1 Red White Green 2 White Orange 3 White Blue 4 Red White Orange 5 Red Blue 6 White Blue 7 White Orange 8 Red White Blue Green 9 Red White Blue 10 Yellow • What is the confidence for “if Blue then White”? 1. 4/5 2. 5/8 3. 5/4 4. 4/8
  • 18. © 2013 ExcelR Solutions. All Rights Reserved Confidence - Weakness • If antecedent and consequent have: High Support => High / Biased Confidence
  • 19. © 2013 ExcelR Solutions. All Rights Reserved Association Rules – Lift Ratio Lift Ratio 3 Confidence / Benchmark confidence Benchmark assumes independence between antecedent & consequent: P(antecedent & consequent) = P(antecedent) X P(consequent) Benchmark confidence P(C|A) = P(C & A) / P(A) = P(C) X P(A) /P(A) = P(C) # transactions with consequent item sets _____________________________________ # transactions in database
  • 20. © 2013 ExcelR Solutions. All Rights Reserved Interpreting Lift • Lift > 1 indicates a rule that is useful in finding consequent item sets • The rule above is much better than selecting random transactions
  • 21. © 2013 ExcelR Solutions. All Rights Reserved Lift - Calculation • What is the Lift for “if White then Blue”? 1. 4/8 2. 5/10 3. 4/5 4. 1 Transaction # Faceplate colors purchased 1 Red White Green 2 White Orange 3 White Blue 4 Red White Orange 5 Red Blue 6 White Blue 7 White Orange 8 Red White Blue Green 9 Red White Blue 10 Yellow
  • 22. © 2013 ExcelR Solutions. All Rights Reserved Rules selection process Generate all rules that meet specified Support & Confidence  Find frequent item sets based on Support specified by applying minimum support cutoff  From these item sets, generate rules with defined Confidence. By filtering remaining rules select only those with high Confidence
  • 23. © 2013 ExcelR Solutions. All Rights Reserved Rules Inputs Data # Transactions in Input Data 10 # Columns in Input Data 6 # Items in Input Data 6 # Association Rules 8 Minimum Support 2 Minimum Confidence 70.00% List of Rules Rule: If all Antecedent items are purchased, then with Confidence percentage Consequent items will also be purchased. Row ID Confidence % Antecedent (A) Consequent (C) Support for A Support for C Support for A & C Lift Ratio 8 100 green red & white 2 4 2 2.5 4 100 green red 2 5 2 2 6 100 white & green red 2 5 2 2 3 100 orange white 3 8 3 1.25 5 100 green white 2 8 2 1.25 7 100 red & green white 2 8 2 1.25 1 80 red white 5 8 4 1 2 80 blue white 5 8 4 1
  • 24. © 2013 ExcelR Solutions. All Rights Reserved Alarming!  Random data can generate apparently interesting association rules  More the rules you produce, greater the danger  Rules based on large numbers of records are less subject to this danger
  • 25. © 2013 ExcelR Solutions. All Rights Reserved Profusion of rules
  • 26. © 2013 ExcelR Solutions. All Rights Reserved Applications • What if Product & Stores are selected as a tuple for analysis? • What if crimes in different geographies for each week is known? Narcotics Robbery AssaultBattery Narcotics Public Peace Violation
  • 27. © 2013 ExcelR Solutions. All Rights Reserved Recap with an example • How can you use the information if you know about the purchase history of customers in a specific geography? • Supermarket database has 100,000 POS transactions • 2000 transactions include both Strepsils & Orange Juice • 800 of the above 2000 include Soup purchases
  • 28. © 2013 ExcelR Solutions. All Rights Reserved Recap with an example • What is the support for rule “IF (Orange Juice & Strepsils) are purchased THEN (Soup) is purchased on the same trip”? 1. 0.8 % 2. 2 % 3. 40 % • What is the confidence for rule “IF (Orange Juice & Strepsils) are purchased THEN (Soup) is purchased on the same trip”? 1. 0.8 % 2. 2 % 3. 40 %
  • 29. © 2013 ExcelR Solutions. All Rights Reserved Recap with an example • What is the lift ratio for rule “IF (Orange Juice & Strepsils) are purchased THEN (Soup) is purchased on the same trip”?
  • 30. © 2013 ExcelR Solutions. All Rights Reserved Sequential Pattern Mining Purchases / events occur at the same time • If person X has taken “Data Mining Unsupervised” training in 1st Quarter, Person X has also taken “Data Mining Supervised” training in 2nd Quarter • Based on the statement above, recommend “Data Mining Supervised” training to those who have enrolled for “Data Mining Unsupervised” NOT IT IS
  • 31. © 2013 ExcelR Solutions. All Rights Reserved Association Rules vs. Sequential Pattern Mining • Look for temporal patterns • Order/sequence of a & b matters for a rule “b follows a” • However, what happens in between a & b doesn’t matter • In phone faceplates dataset:  Association among items, which were bought within the same week were discovered  How about finding what they would buy next week or the week after, if they had bought ‘x’ in this week?
  • 32. © 2013 ExcelR Solutions. All Rights Reserved Applications • Identify the appropriate Basket • Identify popular taxi routes  Sequential pattern from GPS tracks; spatiotemporal records of taxi trajectories  First cluster collocated customers
  • 33. © 2013 ExcelR Solutions. All Rights Reserved THANK YOU