SlideShare a Scribd company logo
Tilani Gunawardena
Covering(Rule-Based)
Algorithms
Example: generating a rule
• Possible rule set for class “a”
• If x > 1.2 then class = a
• If x > 1.2 and y > 2.6 then class = a
• Possible rule set for class “b”:
• If x ≤ 1.2 then class = b
• If x > 1.2 and y ≤ 2.6 then class = b
• Could add more rules, get “perfect” rule set
• Corresponding decision tree: (produces exactly the same
predictions)
• But: rule sets can be more perspicuous when decision trees
suffer from replicated subtrees
• Also: in multiclass situations, covering algorithm
concentrates on one class at a time whereas decision tree
learner takes all classes into account
Rules vs Trees
• Generates a rule by adding tests that
maximize rule’s accuracy
• Similar to situation in decision trees: problem
of selecting an attribute to split on
• Each new test reduces rule’s coverage:
Simple covering algorithm
• Convert decision tree into a rule set
– Straightforward, but rule set overly complex
– More effective conversions are not trivial
• Instead, can generate rule set directly
– for each class in turn find rule set that covers all
instances in it
(excluding instances not in the class)
• Called a covering approach:
– at each stage a rule is identified that “covers”
some of the instances
Covering Algorithms
Selecting a test
• Goal: maximize accuracy
– t total number of instances covered by rule
– p positive examples of the class covered by rule
– t – p number of errors made by rule
 Select test that maximizes the ratio p/t
• We are finished when p/t = 1 or the set of instances can���t be
split any further
Age Spectacle prescription Astigmatism Tear production rate Recommended lenses
Young Myope No Reduced None
Young Myope No Normal Soft
Young Myope Yes Reduced None
Young Myope Yes Normal Hard
Young Hypermetrope No Reduced None
Young Hypermetrope No Normal Soft
Young Hypermetrope Yes Reduced None
Young Hypermetrope Yes Normal Hard
Pre-presbyopic Myope No Reduced None
Pre-presbyopic Myope No Normal Soft
Pre-presbyopic Myope Yes Reduced None
Pre-presbyopic Myope Yes Normal Hard
Pre-presbyopic Hypermetrope No Reduced None
Pre-presbyopic Hypermetrope No Normal Soft
Pre-presbyopic Hypermetrope Yes Reduced None
Pre-presbyopic Hypermetrope Yes Normal None
Presbyopic Myope No Reduced None
Presbyopic Myope No Normal None
Presbyopic Myope Yes Reduced None
Presbyopic Myope Yes Normal Hard
Presbyopic Hypermetrope No Reduced None
Presbyopic Hypermetrope No Normal Soft
Presbyopic Hypermetrope Yes Reduced None
Presbyopic Hypermetrope Yes Normal None
Example: Contact lens data
• Rule we seek:
• Possible tests:
Age = Young
Age = Pre-presbyopic
Age = Presbyopic
Spectacle prescription = Myope
Spectacle prescription = Hypermetrope
Astigmatism = no
Astigmatism = yes
Tear production rate = Reduced
Tear production rate = Normal
If ?
then recommendation = hard
Example: Contact lens data
• Rule we seek:
• Possible tests:
Age = Young 2/8
Age = Pre-presbyopic 1/8
Age = Presbyopic 1/8
Spectacle prescription = Myope 3/12
Spectacle prescription = Hypermetrope 1/12
Astigmatism = no 0/12
Astigmatism = yes 4/12
Tear production rate = Reduced 0/12
Tear production rate = Normal 4/12
If ?
then recommendation = hard
Modified rule and resulting data
• Rule with best test added:
• Instances covered by modified rule:
Age Spectacle prescription Astigmatism Tear production rate Recommended lenses
Young Myope Yes Reduced None
Young Myope Yes Normal Hard
Young Hypermetrope Yes Reduced None
Young Hypermetrope Yes Normal hard
Pre-presbyopic Myope Yes Reduced None
Pre-presbyopic Myope Yes Normal Hard
Pre-presbyopic Hypermetrope Yes Reduced None
Pre-presbyopic Hypermetrope Yes Normal None
Presbyopic Myope Yes Reduced None
Presbyopic Myope Yes Normal Hard
Presbyopic Hypermetrope Yes Reduced None
Presbyopic Hypermetrope Yes Normal None
If astigmatism = yes
then recommendation = hard
Further refinement
• Current state:
• Possible tests:
Age = Young
Age = Pre-presbyopic
Age = Presbyopic
Spectacle prescription = Myope
Spectacle prescription = Hypermetrope
Tear production rate = Reduced
Tear production rate = Normal
If astigmatism = yes
and ?
then recommendation = hard
Further refinement
• Current state:
• Possible tests:
Age = Young 2/4
Age = Pre-presbyopic 1/4
Age = Presbyopic 1/4
Spectacle prescription = Myope 3/6
Spectacle prescription = Hypermetrope 1/6
Tear production rate = Reduced 0/6
Tear production rate = Normal 4/6
If astigmatism = yes
and ?
then recommendation = hard
Modified rule and resulting data
• Rule with best test added:
• Instances covered by modified rule:
Age Spectacle prescription Astigmatism Tear production rate Recommended
lenses
Young Myope Yes Normal Hard
Young Hypermetrope Yes Normal hard
Pre-presbyopic Myope Yes Normal Hard
Pre-presbyopic Hypermetrope Yes Normal None
Presbyopic Myope Yes Normal Hard
Presbyopic Hypermetrope Yes Normal None
If astigmatism = yes
and tear production rate = normal
then recommendation = hard
Further refinement
• Current state:
• Possible tests:
• Tie between the first and the fourth test
– We choose the one with greater coverage
Age = Young 2/2
Age = Pre-presbyopic 1/2
Age = Presbyopic 1/2
Spectacle prescription = Myope 3/3
Spectacle prescription = Hypermetrope 1/3
If astigmatism = yes
and tear production rate = normal
and ?
then recommendation = hard
The result
• Final rule:
• Second rule for recommending “hard lenses”:
(built from instances not covered by first rule)
If astigmatism = yes
and tear production rate = normal
and spectacle prescription = myope
then recommendation = hard
Age Spectacle prescription Astigmatism Tear production rate Recommended lenses
Young Myope No Reduced None
Young Myope No Normal Soft
Young Myope Yes Reduced None
Young Myope Yes Normal Hard
Young Hypermetrope No Reduced None
Young Hypermetrope No Normal Soft
Young Hypermetrope Yes Reduced None
Young Hypermetrope Yes Normal Hard
Pre-presbyopic Myope No Reduced None
Pre-presbyopic Myope No Normal Soft
Pre-presbyopic Myope Yes Reduced None
Pre-presbyopic Myope Yes Normal Hard
Pre-presbyopic Hypermetrope No Reduced None
Pre-presbyopic Hypermetrope No Normal Soft
Pre-presbyopic Hypermetrope Yes Reduced None
Pre-presbyopic Hypermetrope Yes Normal None
Presbyopic Myope No Reduced None
Presbyopic Myope No Normal None
Presbyopic Myope Yes Reduced None
Presbyopic Myope Yes Normal Hard
Presbyopic Hypermetrope No Reduced None
Presbyopic Hypermetrope No Normal Soft
Presbyopic Hypermetrope Yes Reduced None
Presbyopic Hypermetrope Yes Normal None
Age Spectacle prescription Astigmatism Tear production rate Recommended lenses
Young Myope No Reduced None
Young Myope No Normal Soft
Young Myope Yes Reduced None
Young Myope Yes Normal Hard
Young Hypermetrope No Reduced None
Young Hypermetrope No Normal Soft
Young Hypermetrope Yes Reduced None
Young Hypermetrope Yes Normal Hard
Pre-presbyopic Myope No Reduced None
Pre-presbyopic Myope No Normal Soft
Pre-presbyopic Myope Yes Reduced None
Pre-presbyopic Myope Yes Normal Hard
Pre-presbyopic Hypermetrope No Reduced None
Pre-presbyopic Hypermetrope No Normal Soft
Pre-presbyopic Hypermetrope Yes Reduced None
Pre-presbyopic Hypermetrope Yes Normal None
Presbyopic Myope No Reduced None
Presbyopic Myope No Normal None
Presbyopic Myope Yes Reduced None
Presbyopic Myope Yes Normal Hard
Presbyopic Hypermetrope No Reduced None
Presbyopic Hypermetrope No Normal Soft
Presbyopic Hypermetrope Yes Reduced None
Presbyopic Hypermetrope Yes Normal None
Age Spectacle prescription Astigmatism Tear production rate Recommended lenses
Young Myope No Reduced None
Young Myope No Normal Soft
Young Myope Yes Reduced None
Young Hypermetrope No Reduced None
Young Hypermetrope No Normal Soft
Young Hypermetrope Yes Reduced None
Young Hypermetrope Yes Normal Hard
Pre-presbyopic Myope No Reduced None
Pre-presbyopic Myope No Normal Soft
Pre-presbyopic Myope Yes Reduced None
Pre-presbyopic Hypermetrope No Reduced None
Pre-presbyopic Hypermetrope No Normal Soft
Pre-presbyopic Hypermetrope Yes Reduced None
Pre-presbyopic Hypermetrope Yes Normal None
Presbyopic Myope No Reduced None
Presbyopic Myope No Normal None
Presbyopic Myope Yes Reduced None
Presbyopic Hypermetrope No Reduced None
Presbyopic Hypermetrope No Normal Soft
Presbyopic Hypermetrope Yes Reduced None
Presbyopic Hypermetrope Yes Normal None
Example: Contact lens data
• Rule we seek:
• Possible tests:
Age = Young
Age = Pre-presbyopic
Age = Presbyopic
Spectacle prescription = Myope
Spectacle prescription = Hypermetrope
Astigmatism = no
Astigmatism = yes
Tear production rate = Reduced
Tear production rate = Normal
If ?
then recommendation = hard
Example: Contact lens data
• Rule we seek:
• Possible tests:
Age = Young 1/7
Age = Pre-presbyopic 0/7
Age = Presbyopic 0/7
Spectacle prescription = Myope 0/9
Spectacle prescription = Hypermetrope 1/12
Astigmatism = no 0/12
Astigmatism = yes 1/9
Tear production rate = Reduced 0/12
Tear production rate = Normal 1/9
If ?
then recommendation = hard
Modified rule and resulting data
• Rule with best test added:
• Instances covered by modified rule:
If age = Young
then recommendation = hard
Age Spectacle prescription Astigmatism Tear production rate Recommended lenses
Young Myope No Reduced None
Young Myope No Normal Soft
Young Myope Yes Reduced None
Young Hypermetrope No Reduced None
Young Hypermetrope No Normal Soft
Young Hypermetrope Yes Reduced None
Young Hypermetrope Yes Normal Hard
Further refinement
• Current state:
• Possible tests:
If age = Young
and ?
then recommendation = hard
Spectacle prescription = Myope
Spectacle prescription = Hypermetrope
Astigmatism = no
Astigmatism = yes
Tear production rate = Reduced
Tear production rate = Normal
Further refinement
• Current state:
• Possible tests:
If age = Young
and ?
then recommendation = hard
Spectacle prescription = Myope 0/3
Spectacle prescription = Hypermetrope 1/4
Astigmatism = no 0/4
Astigmatism = yes 1/3
Tear production rate = Reduced 0/4
Tear production rate = Normal 1/3
Modified rule and resulting data
• Rule with best test added:
• Instances covered by modified rule:
If age = Young
and Astigmatism = yes
then recommendation = hard
Age Spectacle prescription Astigmatism Tear production rate Recommended lenses
Young Myope Yes Reduced None
Young Hypermetrope Yes Reduced None
Young Hypermetrope Yes Normal Hard
Further refinement
• Current state:
• Possible tests:
Spectacle prescription = Myope
Spectacle prescription = Hypermetrope
Tear production rate = Reduced
Tear production rate = Normal
If age = Young
and Astigmatism = yes
and ?
then recommendation = hard
Further refinement
• Current state:
• Possible tests:
Spectacle prescription = Myope 0/1
Spectacle prescription = Hypermetrope 1/2
Tear production rate = Reduced 0/2
Tear production rate = Normal 1/1
If age = Young
and Astigmatism = yes
and ?
then recommendation = hard
Final Results
If age = Young
and astigmatism = yes
and tear production rate=normal
then recommendation = hard
Age Spectacle prescription Astigmatism Tear production rate Recommended lenses
Young Myope Yes Normal Hard
Young Hypermetrope Yes Normal Hard
If astigmatism = yes
and tear production rate = normal
and spectacle prescription = myope
then recommendation = hard
Age Spectacle prescription Astigmatism Tear production rate Recommended lenses
Young Myope Yes Normal Hard
Pre-presbyopic Myope Yes Normal Hard
Presbyopic Myope Yes Normal Hard
Pseudo-code for PRISM
For each class C
Initialize E to the instance set
While E contains instances in class C
Create a rule R with an empty left-hand side that predicts class C
Until R is perfect (or there are no more attributes to use) do
For each attribute A not mentioned in R, and each value v,
Consider adding the condition A = v to the left-hand side of R
Select A and v to maximize the accuracy p/t
(break ties by choosing the condition with the largest p)
Add A = v to R
Remove the instances covered by R from E
• PRISM with outer loop removed generates a
decision list for one class
– Subsequent rules are designed for rules that are
not covered by previous rules
– Order doesn’t matter because all rules predict the
same class
• Outer loop considers all classes separately
– No order dependence implied
Separate and conquer
• Methods like PRISM (for dealing with one
class) are separate-and-conquer algorithms:
– First, a rule is identified
– Then, all instances covered by the rule are
separated out
– Finally, the remaining instances are “conquered”
• Difference to divide-and-conquer methods:
– Subset covered by rule doesn’t need to be
explored any further

More Related Content

Similar to Covering algorithm

Machine Learning and Data Mining: 10 Introduction to Classification
Machine Learning and Data Mining: 10 Introduction to ClassificationMachine Learning and Data Mining: 10 Introduction to Classification
Machine Learning and Data Mining: 10 Introduction to Classification
Pier Luca Lanzi
 
RR and Rx.pptx
RR and Rx.pptxRR and Rx.pptx
RR and Rx.pptx
mikaelgirum
 
challenges in pediatric refraction. Practical approach pptx
challenges in pediatric refraction. Practical approach pptxchallenges in pediatric refraction. Practical approach pptx
challenges in pediatric refraction. Practical approach pptx
SarbindYadav1
 
MUGABI ON ASTIGMATISM.pptx
MUGABI ON ASTIGMATISM.pptxMUGABI ON ASTIGMATISM.pptx
MUGABI ON ASTIGMATISM.pptx
BARNABASMUGABI
 
NAVP Treatment of Amblyopia
NAVP Treatment of AmblyopiaNAVP Treatment of Amblyopia
NAVP Treatment of Amblyopia
Pranas Pranckevicius
 
Eyeglass prescribing in children 2024 SLMC.pdf
Eyeglass prescribing in children 2024 SLMC.pdfEyeglass prescribing in children 2024 SLMC.pdf
Eyeglass prescribing in children 2024 SLMC.pdf
Alvina Pauline Santiago, MD
 
Lecture 03 Data Representation
Lecture 03 Data RepresentationLecture 03 Data Representation
Lecture 03 Data Representation
Pier Luca Lanzi
 
Challenging Refraction
Challenging RefractionChallenging Refraction
Challenging Refraction
Indra Prasad Sharma
 
Glasses prescription clinical tips.pptx
Glasses prescription clinical tips.pptxGlasses prescription clinical tips.pptx
Glasses prescription clinical tips.pptx
Mohamed Elkadim
 
Passive Therapy in Management of Amblyopia (healthkura.com)
Passive Therapy in Management of Amblyopia (healthkura.com)Passive Therapy in Management of Amblyopia (healthkura.com)
Passive Therapy in Management of Amblyopia (healthkura.com)
Bikash Sapkota
 
tips in prescribing children glasses.pptx
tips in prescribing children glasses.pptxtips in prescribing children glasses.pptx
tips in prescribing children glasses.pptx
Amr mohamed
 
How to Prescribe Eyeglasses in Children recap
How to Prescribe Eyeglasses in Children recapHow to Prescribe Eyeglasses in Children recap
How to Prescribe Eyeglasses in Children recap
Alvina Pauline Santiago, MD
 
Prescription of glasses in children
Prescription of glasses in childrenPrescription of glasses in children
Prescription of glasses in children
Eranda Wannigama
 
mod_02_intro_ml.ppt
mod_02_intro_ml.pptmod_02_intro_ml.ppt
mod_02_intro_ml.ppt
butest
 
Real Refractive error and spectacle correction.ppt
Real Refractive error and spectacle correction.pptReal Refractive error and spectacle correction.ppt
Real Refractive error and spectacle correction.ppt
Bipin Koirala
 
Prescription for ametropias
Prescription for ametropiasPrescription for ametropias
Prescription for ametropias
Indra Prasad Sharma
 
Part XIV
Part XIVPart XIV
Part XIV
butest
 
Prescribing Eyeglasses in Children
Prescribing Eyeglasses in Children Prescribing Eyeglasses in Children
Prescribing Eyeglasses in Children
Alvina Pauline Santiago, MD
 
Hypermetropia
HypermetropiaHypermetropia
Hypermetropia
ShrutiDagar1
 
POAG 67.pptx
POAG 67.pptxPOAG 67.pptx
POAG 67.pptx
ShivamSharma449446
 

Similar to Covering algorithm (20)

Machine Learning and Data Mining: 10 Introduction to Classification
Machine Learning and Data Mining: 10 Introduction to ClassificationMachine Learning and Data Mining: 10 Introduction to Classification
Machine Learning and Data Mining: 10 Introduction to Classification
 
RR and Rx.pptx
RR and Rx.pptxRR and Rx.pptx
RR and Rx.pptx
 
challenges in pediatric refraction. Practical approach pptx
challenges in pediatric refraction. Practical approach pptxchallenges in pediatric refraction. Practical approach pptx
challenges in pediatric refraction. Practical approach pptx
 
MUGABI ON ASTIGMATISM.pptx
MUGABI ON ASTIGMATISM.pptxMUGABI ON ASTIGMATISM.pptx
MUGABI ON ASTIGMATISM.pptx
 
NAVP Treatment of Amblyopia
NAVP Treatment of AmblyopiaNAVP Treatment of Amblyopia
NAVP Treatment of Amblyopia
 
Eyeglass prescribing in children 2024 SLMC.pdf
Eyeglass prescribing in children 2024 SLMC.pdfEyeglass prescribing in children 2024 SLMC.pdf
Eyeglass prescribing in children 2024 SLMC.pdf
 
Lecture 03 Data Representation
Lecture 03 Data RepresentationLecture 03 Data Representation
Lecture 03 Data Representation
 
Challenging Refraction
Challenging RefractionChallenging Refraction
Challenging Refraction
 
Glasses prescription clinical tips.pptx
Glasses prescription clinical tips.pptxGlasses prescription clinical tips.pptx
Glasses prescription clinical tips.pptx
 
Passive Therapy in Management of Amblyopia (healthkura.com)
Passive Therapy in Management of Amblyopia (healthkura.com)Passive Therapy in Management of Amblyopia (healthkura.com)
Passive Therapy in Management of Amblyopia (healthkura.com)
 
tips in prescribing children glasses.pptx
tips in prescribing children glasses.pptxtips in prescribing children glasses.pptx
tips in prescribing children glasses.pptx
 
How to Prescribe Eyeglasses in Children recap
How to Prescribe Eyeglasses in Children recapHow to Prescribe Eyeglasses in Children recap
How to Prescribe Eyeglasses in Children recap
 
Prescription of glasses in children
Prescription of glasses in childrenPrescription of glasses in children
Prescription of glasses in children
 
mod_02_intro_ml.ppt
mod_02_intro_ml.pptmod_02_intro_ml.ppt
mod_02_intro_ml.ppt
 
Real Refractive error and spectacle correction.ppt
Real Refractive error and spectacle correction.pptReal Refractive error and spectacle correction.ppt
Real Refractive error and spectacle correction.ppt
 
Prescription for ametropias
Prescription for ametropiasPrescription for ametropias
Prescription for ametropias
 
Part XIV
Part XIVPart XIV
Part XIV
 
Prescribing Eyeglasses in Children
Prescribing Eyeglasses in Children Prescribing Eyeglasses in Children
Prescribing Eyeglasses in Children
 
Hypermetropia
HypermetropiaHypermetropia
Hypermetropia
 
POAG 67.pptx
POAG 67.pptxPOAG 67.pptx
POAG 67.pptx
 

More from Tilani Gunawardena PhD(UNIBAS), BSc(Pera), FHEA(UK), CEng, MIESL

BlockChain.pptx
BlockChain.pptxBlockChain.pptx
Introduction to data mining and machine learning
Introduction to data mining and machine learningIntroduction to data mining and machine learning
Introduction to data mining and machine learning
Tilani Gunawardena PhD(UNIBAS), BSc(Pera), FHEA(UK), CEng, MIESL
 
Introduction to cloud computing
Introduction to cloud computingIntroduction to cloud computing
Data analytics
Data analyticsData analytics
Hadoop Eco system
Hadoop Eco systemHadoop Eco system
Parallel Computing on the GPU
Parallel Computing on the GPUParallel Computing on the GPU
evaluation and credibility-Part 2
evaluation and credibility-Part 2evaluation and credibility-Part 2
evaluation and credibility-Part 1
evaluation and credibility-Part 1evaluation and credibility-Part 1
Machine Learning and Data Mining
Machine Learning and Data MiningMachine Learning and Data Mining
K Nearest Neighbors
K Nearest NeighborsK Nearest Neighbors
Decision tree
Decision treeDecision tree
kmean clustering
kmean clusteringkmean clustering
Hierachical clustering
Hierachical clusteringHierachical clustering
Assosiate rule mining
Assosiate rule miningAssosiate rule mining
Big data in telecom
Big data in telecomBig data in telecom
Cloud Computing
Cloud ComputingCloud Computing
MapReduce
MapReduceMapReduce
Cheetah:Data Warehouse on Top of MapReduce
Cheetah:Data Warehouse on Top of MapReduceCheetah:Data Warehouse on Top of MapReduce
Cheetah:Data Warehouse on Top of MapReduce
Tilani Gunawardena PhD(UNIBAS), BSc(Pera), FHEA(UK), CEng, MIESL
 
Pig Experience
Pig ExperiencePig Experience
Interpreting the Data:Parallel Analysis with Sawzall
Interpreting the Data:Parallel Analysis with SawzallInterpreting the Data:Parallel Analysis with Sawzall
Interpreting the Data:Parallel Analysis with Sawzall
Tilani Gunawardena PhD(UNIBAS), BSc(Pera), FHEA(UK), CEng, MIESL
 

More from Tilani Gunawardena PhD(UNIBAS), BSc(Pera), FHEA(UK), CEng, MIESL (20)

BlockChain.pptx
BlockChain.pptxBlockChain.pptx
BlockChain.pptx
 
Introduction to data mining and machine learning
Introduction to data mining and machine learningIntroduction to data mining and machine learning
Introduction to data mining and machine learning
 
Introduction to cloud computing
Introduction to cloud computingIntroduction to cloud computing
Introduction to cloud computing
 
Data analytics
Data analyticsData analytics
Data analytics
 
Hadoop Eco system
Hadoop Eco systemHadoop Eco system
Hadoop Eco system
 
Parallel Computing on the GPU
Parallel Computing on the GPUParallel Computing on the GPU
Parallel Computing on the GPU
 
evaluation and credibility-Part 2
evaluation and credibility-Part 2evaluation and credibility-Part 2
evaluation and credibility-Part 2
 
evaluation and credibility-Part 1
evaluation and credibility-Part 1evaluation and credibility-Part 1
evaluation and credibility-Part 1
 
Machine Learning and Data Mining
Machine Learning and Data MiningMachine Learning and Data Mining
Machine Learning and Data Mining
 
K Nearest Neighbors
K Nearest NeighborsK Nearest Neighbors
K Nearest Neighbors
 
Decision tree
Decision treeDecision tree
Decision tree
 
kmean clustering
kmean clusteringkmean clustering
kmean clustering
 
Hierachical clustering
Hierachical clusteringHierachical clustering
Hierachical clustering
 
Assosiate rule mining
Assosiate rule miningAssosiate rule mining
Assosiate rule mining
 
Big data in telecom
Big data in telecomBig data in telecom
Big data in telecom
 
Cloud Computing
Cloud ComputingCloud Computing
Cloud Computing
 
MapReduce
MapReduceMapReduce
MapReduce
 
Cheetah:Data Warehouse on Top of MapReduce
Cheetah:Data Warehouse on Top of MapReduceCheetah:Data Warehouse on Top of MapReduce
Cheetah:Data Warehouse on Top of MapReduce
 
Pig Experience
Pig ExperiencePig Experience
Pig Experience
 
Interpreting the Data:Parallel Analysis with Sawzall
Interpreting the Data:Parallel Analysis with SawzallInterpreting the Data:Parallel Analysis with Sawzall
Interpreting the Data:Parallel Analysis with Sawzall
 

Recently uploaded

FINAL MATATAG PE and Health CG 2023 Grades 4-10.pdf
FINAL MATATAG PE and Health CG 2023 Grades 4-10.pdfFINAL MATATAG PE and Health CG 2023 Grades 4-10.pdf
FINAL MATATAG PE and Health CG 2023 Grades 4-10.pdf
HayddieMaeCapunong
 
C++ Interview Questions and Answers PDF By ScholarHat
C++ Interview Questions and Answers PDF By ScholarHatC++ Interview Questions and Answers PDF By ScholarHat
C++ Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
A history of Innisfree in Milanville, Pennsylvania
A history of Innisfree in Milanville, PennsylvaniaA history of Innisfree in Milanville, Pennsylvania
A history of Innisfree in Milanville, Pennsylvania
ThomasRue2
 
Production Technology of Mango in Nepal.pptx
Production Technology of Mango in Nepal.pptxProduction Technology of Mango in Nepal.pptx
Production Technology of Mango in Nepal.pptx
UmeshTimilsina1
 
SQL Server Interview Questions PDF By ScholarHat
SQL Server Interview Questions PDF By ScholarHatSQL Server Interview Questions PDF By ScholarHat
SQL Server Interview Questions PDF By ScholarHat
Scholarhat
 
Reports in Odoo 17 Point of Sale - Odoo Slides
Reports in Odoo 17 Point of Sale - Odoo SlidesReports in Odoo 17 Point of Sale - Odoo Slides
Reports in Odoo 17 Point of Sale - Odoo Slides
Celine George
 
Brigada Eskwela editable Certificate.pptx
Brigada Eskwela editable Certificate.pptxBrigada Eskwela editable Certificate.pptx
Brigada Eskwela editable Certificate.pptx
aiofits06
 
How to Fix Field Does Not Exist Error in Odoo 17
How to Fix Field Does Not Exist Error in Odoo 17How to Fix Field Does Not Exist Error in Odoo 17
How to Fix Field Does Not Exist Error in Odoo 17
Celine George
 
React Interview Question PDF By ScholarHat
React Interview Question PDF By ScholarHatReact Interview Question PDF By ScholarHat
React Interview Question PDF By ScholarHat
Scholarhat
 
Lecture Notes Unit4 Chapter13 users , roles and privileges
Lecture Notes Unit4 Chapter13 users , roles and privilegesLecture Notes Unit4 Chapter13 users , roles and privileges
Lecture Notes Unit4 Chapter13 users , roles and privileges
Murugan146644
 
New Features in Odoo 17 Email Marketing - Odoo Slides
New Features in Odoo 17 Email Marketing - Odoo SlidesNew Features in Odoo 17 Email Marketing - Odoo Slides
New Features in Odoo 17 Email Marketing - Odoo Slides
Celine George
 
Java Full Stack Developer Interview Questions PDF By ScholarHat
Java Full Stack Developer Interview Questions PDF By ScholarHatJava Full Stack Developer Interview Questions PDF By ScholarHat
Java Full Stack Developer Interview Questions PDF By ScholarHat
Scholarhat
 
Class 6 English Chapter 1 Fables and Folk Stories
Class 6 English Chapter 1 Fables and Folk StoriesClass 6 English Chapter 1 Fables and Folk Stories
Class 6 English Chapter 1 Fables and Folk Stories
sweetygupta8413
 
QCE – Unpacking the syllabus Implications for Senior School practices and ass...
QCE – Unpacking the syllabus Implications for Senior School practices and ass...QCE – Unpacking the syllabus Implications for Senior School practices and ass...
QCE – Unpacking the syllabus Implications for Senior School practices and ass...
mansk2
 
21stcenturyskillsframeworkfinalpresentation2-240509214747-71edb7ee.pptx
21stcenturyskillsframeworkfinalpresentation2-240509214747-71edb7ee.pptx21stcenturyskillsframeworkfinalpresentation2-240509214747-71edb7ee.pptx
21stcenturyskillsframeworkfinalpresentation2-240509214747-71edb7ee.pptx
OliverVillanueva13
 
New features of Maintenance Module in Odoo 17
New features of Maintenance Module in Odoo 17New features of Maintenance Module in Odoo 17
New features of Maintenance Module in Odoo 17
Celine George
 
Microservices Interview Questions and Answers PDF By ScholarHat
Microservices Interview Questions and Answers PDF By ScholarHatMicroservices Interview Questions and Answers PDF By ScholarHat
Microservices Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
Form for Brigada eskwela-04 SY 2024.docx
Form for Brigada eskwela-04 SY 2024.docxForm for Brigada eskwela-04 SY 2024.docx
Form for Brigada eskwela-04 SY 2024.docx
VenuzSayanAday
 
Parkinson Disease & Anti-Parkinsonian Drugs.pptx
Parkinson Disease & Anti-Parkinsonian Drugs.pptxParkinson Disease & Anti-Parkinsonian Drugs.pptx
Parkinson Disease & Anti-Parkinsonian Drugs.pptx
AnujVishwakarma34
 

Recently uploaded (20)

FINAL MATATAG PE and Health CG 2023 Grades 4-10.pdf
FINAL MATATAG PE and Health CG 2023 Grades 4-10.pdfFINAL MATATAG PE and Health CG 2023 Grades 4-10.pdf
FINAL MATATAG PE and Health CG 2023 Grades 4-10.pdf
 
C++ Interview Questions and Answers PDF By ScholarHat
C++ Interview Questions and Answers PDF By ScholarHatC++ Interview Questions and Answers PDF By ScholarHat
C++ Interview Questions and Answers PDF By ScholarHat
 
A history of Innisfree in Milanville, Pennsylvania
A history of Innisfree in Milanville, PennsylvaniaA history of Innisfree in Milanville, Pennsylvania
A history of Innisfree in Milanville, Pennsylvania
 
Production Technology of Mango in Nepal.pptx
Production Technology of Mango in Nepal.pptxProduction Technology of Mango in Nepal.pptx
Production Technology of Mango in Nepal.pptx
 
SQL Server Interview Questions PDF By ScholarHat
SQL Server Interview Questions PDF By ScholarHatSQL Server Interview Questions PDF By ScholarHat
SQL Server Interview Questions PDF By ScholarHat
 
Reports in Odoo 17 Point of Sale - Odoo Slides
Reports in Odoo 17 Point of Sale - Odoo SlidesReports in Odoo 17 Point of Sale - Odoo Slides
Reports in Odoo 17 Point of Sale - Odoo Slides
 
Brigada Eskwela editable Certificate.pptx
Brigada Eskwela editable Certificate.pptxBrigada Eskwela editable Certificate.pptx
Brigada Eskwela editable Certificate.pptx
 
How to Fix Field Does Not Exist Error in Odoo 17
How to Fix Field Does Not Exist Error in Odoo 17How to Fix Field Does Not Exist Error in Odoo 17
How to Fix Field Does Not Exist Error in Odoo 17
 
UM “ATÉ JÁ” ANIMADO! . .
UM “ATÉ JÁ” ANIMADO!                        .            .UM “ATÉ JÁ” ANIMADO!                        .            .
UM “ATÉ JÁ” ANIMADO! . .
 
React Interview Question PDF By ScholarHat
React Interview Question PDF By ScholarHatReact Interview Question PDF By ScholarHat
React Interview Question PDF By ScholarHat
 
Lecture Notes Unit4 Chapter13 users , roles and privileges
Lecture Notes Unit4 Chapter13 users , roles and privilegesLecture Notes Unit4 Chapter13 users , roles and privileges
Lecture Notes Unit4 Chapter13 users , roles and privileges
 
New Features in Odoo 17 Email Marketing - Odoo Slides
New Features in Odoo 17 Email Marketing - Odoo SlidesNew Features in Odoo 17 Email Marketing - Odoo Slides
New Features in Odoo 17 Email Marketing - Odoo Slides
 
Java Full Stack Developer Interview Questions PDF By ScholarHat
Java Full Stack Developer Interview Questions PDF By ScholarHatJava Full Stack Developer Interview Questions PDF By ScholarHat
Java Full Stack Developer Interview Questions PDF By ScholarHat
 
Class 6 English Chapter 1 Fables and Folk Stories
Class 6 English Chapter 1 Fables and Folk StoriesClass 6 English Chapter 1 Fables and Folk Stories
Class 6 English Chapter 1 Fables and Folk Stories
 
QCE – Unpacking the syllabus Implications for Senior School practices and ass...
QCE – Unpacking the syllabus Implications for Senior School practices and ass...QCE – Unpacking the syllabus Implications for Senior School practices and ass...
QCE – Unpacking the syllabus Implications for Senior School practices and ass...
 
21stcenturyskillsframeworkfinalpresentation2-240509214747-71edb7ee.pptx
21stcenturyskillsframeworkfinalpresentation2-240509214747-71edb7ee.pptx21stcenturyskillsframeworkfinalpresentation2-240509214747-71edb7ee.pptx
21stcenturyskillsframeworkfinalpresentation2-240509214747-71edb7ee.pptx
 
New features of Maintenance Module in Odoo 17
New features of Maintenance Module in Odoo 17New features of Maintenance Module in Odoo 17
New features of Maintenance Module in Odoo 17
 
Microservices Interview Questions and Answers PDF By ScholarHat
Microservices Interview Questions and Answers PDF By ScholarHatMicroservices Interview Questions and Answers PDF By ScholarHat
Microservices Interview Questions and Answers PDF By ScholarHat
 
Form for Brigada eskwela-04 SY 2024.docx
Form for Brigada eskwela-04 SY 2024.docxForm for Brigada eskwela-04 SY 2024.docx
Form for Brigada eskwela-04 SY 2024.docx
 
Parkinson Disease & Anti-Parkinsonian Drugs.pptx
Parkinson Disease & Anti-Parkinsonian Drugs.pptxParkinson Disease & Anti-Parkinsonian Drugs.pptx
Parkinson Disease & Anti-Parkinsonian Drugs.pptx
 

Covering algorithm

  • 2. Example: generating a rule • Possible rule set for class “a” • If x > 1.2 then class = a • If x > 1.2 and y > 2.6 then class = a • Possible rule set for class “b”: • If x ≤ 1.2 then class = b • If x > 1.2 and y ≤ 2.6 then class = b • Could add more rules, get “perfect” rule set
  • 3. • Corresponding decision tree: (produces exactly the same predictions) • But: rule sets can be more perspicuous when decision trees suffer from replicated subtrees • Also: in multiclass situations, covering algorithm concentrates on one class at a time whereas decision tree learner takes all classes into account Rules vs Trees
  • 4. • Generates a rule by adding tests that maximize rule’s accuracy • Similar to situation in decision trees: problem of selecting an attribute to split on • Each new test reduces rule’s coverage: Simple covering algorithm
  • 5. • Convert decision tree into a rule set – Straightforward, but rule set overly complex – More effective conversions are not trivial • Instead, can generate rule set directly – for each class in turn find rule set that covers all instances in it (excluding instances not in the class) • Called a covering approach: – at each stage a rule is identified that “covers” some of the instances Covering Algorithms
  • 6. Selecting a test • Goal: maximize accuracy – t total number of instances covered by rule – p positive examples of the class covered by rule – t – p number of errors made by rule  Select test that maximizes the ratio p/t • We are finished when p/t = 1 or the set of instances can’t be split any further
  • 7. Age Spectacle prescription Astigmatism Tear production rate Recommended lenses Young Myope No Reduced None Young Myope No Normal Soft Young Myope Yes Reduced None Young Myope Yes Normal Hard Young Hypermetrope No Reduced None Young Hypermetrope No Normal Soft Young Hypermetrope Yes Reduced None Young Hypermetrope Yes Normal Hard Pre-presbyopic Myope No Reduced None Pre-presbyopic Myope No Normal Soft Pre-presbyopic Myope Yes Reduced None Pre-presbyopic Myope Yes Normal Hard Pre-presbyopic Hypermetrope No Reduced None Pre-presbyopic Hypermetrope No Normal Soft Pre-presbyopic Hypermetrope Yes Reduced None Pre-presbyopic Hypermetrope Yes Normal None Presbyopic Myope No Reduced None Presbyopic Myope No Normal None Presbyopic Myope Yes Reduced None Presbyopic Myope Yes Normal Hard Presbyopic Hypermetrope No Reduced None Presbyopic Hypermetrope No Normal Soft Presbyopic Hypermetrope Yes Reduced None Presbyopic Hypermetrope Yes Normal None
  • 8. Example: Contact lens data • Rule we seek: • Possible tests: Age = Young Age = Pre-presbyopic Age = Presbyopic Spectacle prescription = Myope Spectacle prescription = Hypermetrope Astigmatism = no Astigmatism = yes Tear production rate = Reduced Tear production rate = Normal If ? then recommendation = hard
  • 9. Example: Contact lens data • Rule we seek: • Possible tests: Age = Young 2/8 Age = Pre-presbyopic 1/8 Age = Presbyopic 1/8 Spectacle prescription = Myope 3/12 Spectacle prescription = Hypermetrope 1/12 Astigmatism = no 0/12 Astigmatism = yes 4/12 Tear production rate = Reduced 0/12 Tear production rate = Normal 4/12 If ? then recommendation = hard
  • 10. Modified rule and resulting data • Rule with best test added: • Instances covered by modified rule: Age Spectacle prescription Astigmatism Tear production rate Recommended lenses Young Myope Yes Reduced None Young Myope Yes Normal Hard Young Hypermetrope Yes Reduced None Young Hypermetrope Yes Normal hard Pre-presbyopic Myope Yes Reduced None Pre-presbyopic Myope Yes Normal Hard Pre-presbyopic Hypermetrope Yes Reduced None Pre-presbyopic Hypermetrope Yes Normal None Presbyopic Myope Yes Reduced None Presbyopic Myope Yes Normal Hard Presbyopic Hypermetrope Yes Reduced None Presbyopic Hypermetrope Yes Normal None If astigmatism = yes then recommendation = hard
  • 11. Further refinement • Current state: • Possible tests: Age = Young Age = Pre-presbyopic Age = Presbyopic Spectacle prescription = Myope Spectacle prescription = Hypermetrope Tear production rate = Reduced Tear production rate = Normal If astigmatism = yes and ? then recommendation = hard
  • 12. Further refinement • Current state: • Possible tests: Age = Young 2/4 Age = Pre-presbyopic 1/4 Age = Presbyopic 1/4 Spectacle prescription = Myope 3/6 Spectacle prescription = Hypermetrope 1/6 Tear production rate = Reduced 0/6 Tear production rate = Normal 4/6 If astigmatism = yes and ? then recommendation = hard
  • 13. Modified rule and resulting data • Rule with best test added: • Instances covered by modified rule: Age Spectacle prescription Astigmatism Tear production rate Recommended lenses Young Myope Yes Normal Hard Young Hypermetrope Yes Normal hard Pre-presbyopic Myope Yes Normal Hard Pre-presbyopic Hypermetrope Yes Normal None Presbyopic Myope Yes Normal Hard Presbyopic Hypermetrope Yes Normal None If astigmatism = yes and tear production rate = normal then recommendation = hard
  • 14. Further refinement • Current state: • Possible tests: • Tie between the first and the fourth test – We choose the one with greater coverage Age = Young 2/2 Age = Pre-presbyopic 1/2 Age = Presbyopic 1/2 Spectacle prescription = Myope 3/3 Spectacle prescription = Hypermetrope 1/3 If astigmatism = yes and tear production rate = normal and ? then recommendation = hard
  • 15. The result • Final rule: • Second rule for recommending “hard lenses”: (built from instances not covered by first rule) If astigmatism = yes and tear production rate = normal and spectacle prescription = myope then recommendation = hard
  • 16. Age Spectacle prescription Astigmatism Tear production rate Recommended lenses Young Myope No Reduced None Young Myope No Normal Soft Young Myope Yes Reduced None Young Myope Yes Normal Hard Young Hypermetrope No Reduced None Young Hypermetrope No Normal Soft Young Hypermetrope Yes Reduced None Young Hypermetrope Yes Normal Hard Pre-presbyopic Myope No Reduced None Pre-presbyopic Myope No Normal Soft Pre-presbyopic Myope Yes Reduced None Pre-presbyopic Myope Yes Normal Hard Pre-presbyopic Hypermetrope No Reduced None Pre-presbyopic Hypermetrope No Normal Soft Pre-presbyopic Hypermetrope Yes Reduced None Pre-presbyopic Hypermetrope Yes Normal None Presbyopic Myope No Reduced None Presbyopic Myope No Normal None Presbyopic Myope Yes Reduced None Presbyopic Myope Yes Normal Hard Presbyopic Hypermetrope No Reduced None Presbyopic Hypermetrope No Normal Soft Presbyopic Hypermetrope Yes Reduced None Presbyopic Hypermetrope Yes Normal None
  • 17. Age Spectacle prescription Astigmatism Tear production rate Recommended lenses Young Myope No Reduced None Young Myope No Normal Soft Young Myope Yes Reduced None Young Myope Yes Normal Hard Young Hypermetrope No Reduced None Young Hypermetrope No Normal Soft Young Hypermetrope Yes Reduced None Young Hypermetrope Yes Normal Hard Pre-presbyopic Myope No Reduced None Pre-presbyopic Myope No Normal Soft Pre-presbyopic Myope Yes Reduced None Pre-presbyopic Myope Yes Normal Hard Pre-presbyopic Hypermetrope No Reduced None Pre-presbyopic Hypermetrope No Normal Soft Pre-presbyopic Hypermetrope Yes Reduced None Pre-presbyopic Hypermetrope Yes Normal None Presbyopic Myope No Reduced None Presbyopic Myope No Normal None Presbyopic Myope Yes Reduced None Presbyopic Myope Yes Normal Hard Presbyopic Hypermetrope No Reduced None Presbyopic Hypermetrope No Normal Soft Presbyopic Hypermetrope Yes Reduced None Presbyopic Hypermetrope Yes Normal None
  • 18. Age Spectacle prescription Astigmatism Tear production rate Recommended lenses Young Myope No Reduced None Young Myope No Normal Soft Young Myope Yes Reduced None Young Hypermetrope No Reduced None Young Hypermetrope No Normal Soft Young Hypermetrope Yes Reduced None Young Hypermetrope Yes Normal Hard Pre-presbyopic Myope No Reduced None Pre-presbyopic Myope No Normal Soft Pre-presbyopic Myope Yes Reduced None Pre-presbyopic Hypermetrope No Reduced None Pre-presbyopic Hypermetrope No Normal Soft Pre-presbyopic Hypermetrope Yes Reduced None Pre-presbyopic Hypermetrope Yes Normal None Presbyopic Myope No Reduced None Presbyopic Myope No Normal None Presbyopic Myope Yes Reduced None Presbyopic Hypermetrope No Reduced None Presbyopic Hypermetrope No Normal Soft Presbyopic Hypermetrope Yes Reduced None Presbyopic Hypermetrope Yes Normal None
  • 19. Example: Contact lens data • Rule we seek: • Possible tests: Age = Young Age = Pre-presbyopic Age = Presbyopic Spectacle prescription = Myope Spectacle prescription = Hypermetrope Astigmatism = no Astigmatism = yes Tear production rate = Reduced Tear production rate = Normal If ? then recommendation = hard
  • 20. Example: Contact lens data • Rule we seek: • Possible tests: Age = Young 1/7 Age = Pre-presbyopic 0/7 Age = Presbyopic 0/7 Spectacle prescription = Myope 0/9 Spectacle prescription = Hypermetrope 1/12 Astigmatism = no 0/12 Astigmatism = yes 1/9 Tear production rate = Reduced 0/12 Tear production rate = Normal 1/9 If ? then recommendation = hard
  • 21. Modified rule and resulting data • Rule with best test added: • Instances covered by modified rule: If age = Young then recommendation = hard Age Spectacle prescription Astigmatism Tear production rate Recommended lenses Young Myope No Reduced None Young Myope No Normal Soft Young Myope Yes Reduced None Young Hypermetrope No Reduced None Young Hypermetrope No Normal Soft Young Hypermetrope Yes Reduced None Young Hypermetrope Yes Normal Hard
  • 22. Further refinement • Current state: • Possible tests: If age = Young and ? then recommendation = hard Spectacle prescription = Myope Spectacle prescription = Hypermetrope Astigmatism = no Astigmatism = yes Tear production rate = Reduced Tear production rate = Normal
  • 23. Further refinement • Current state: • Possible tests: If age = Young and ? then recommendation = hard Spectacle prescription = Myope 0/3 Spectacle prescription = Hypermetrope 1/4 Astigmatism = no 0/4 Astigmatism = yes 1/3 Tear production rate = Reduced 0/4 Tear production rate = Normal 1/3
  • 24. Modified rule and resulting data • Rule with best test added: • Instances covered by modified rule: If age = Young and Astigmatism = yes then recommendation = hard Age Spectacle prescription Astigmatism Tear production rate Recommended lenses Young Myope Yes Reduced None Young Hypermetrope Yes Reduced None Young Hypermetrope Yes Normal Hard
  • 25. Further refinement • Current state: • Possible tests: Spectacle prescription = Myope Spectacle prescription = Hypermetrope Tear production rate = Reduced Tear production rate = Normal If age = Young and Astigmatism = yes and ? then recommendation = hard
  • 26. Further refinement • Current state: • Possible tests: Spectacle prescription = Myope 0/1 Spectacle prescription = Hypermetrope 1/2 Tear production rate = Reduced 0/2 Tear production rate = Normal 1/1 If age = Young and Astigmatism = yes and ? then recommendation = hard
  • 27. Final Results If age = Young and astigmatism = yes and tear production rate=normal then recommendation = hard Age Spectacle prescription Astigmatism Tear production rate Recommended lenses Young Myope Yes Normal Hard Young Hypermetrope Yes Normal Hard If astigmatism = yes and tear production rate = normal and spectacle prescription = myope then recommendation = hard Age Spectacle prescription Astigmatism Tear production rate Recommended lenses Young Myope Yes Normal Hard Pre-presbyopic Myope Yes Normal Hard Presbyopic Myope Yes Normal Hard
  • 28. Pseudo-code for PRISM For each class C Initialize E to the instance set While E contains instances in class C Create a rule R with an empty left-hand side that predicts class C Until R is perfect (or there are no more attributes to use) do For each attribute A not mentioned in R, and each value v, Consider adding the condition A = v to the left-hand side of R Select A and v to maximize the accuracy p/t (break ties by choosing the condition with the largest p) Add A = v to R Remove the instances covered by R from E
  • 29. • PRISM with outer loop removed generates a decision list for one class – Subsequent rules are designed for rules that are not covered by previous rules – Order doesn’t matter because all rules predict the same class • Outer loop considers all classes separately – No order dependence implied
  • 30. Separate and conquer • Methods like PRISM (for dealing with one class) are separate-and-conquer algorithms: – First, a rule is identified – Then, all instances covered by the rule are separated out – Finally, the remaining instances are “conquered” • Difference to divide-and-conquer methods: – Subset covered by rule doesn’t need to be explored any further