SlideShare ist ein Scribd-Unternehmen logo
1 von 11
Downloaden Sie, um offline zu lesen
Naïve Bayes Classifiers
Dae-Ki Kang
Probability
• What is the probability that you get hit in the
head with bird droppings when you go outside?
▫ Initially shown in one episode of Korea TV show
▫ Asked in one BBS of an elite group in Korea
 no one gave the right answer
• It is difficult to define “probability”
▫ As difficult as defining “science”, “history”, etc.
• 16 different definitions
• Frequentist vs. Bayesian
Bayesian Probability
• Can assign probability on any statement
• Can be used to show the degree of one’s belief, or
degree of one’s knowledge.
• Example of subjectiveness: Alice, Bob, and Carol
▫ Alice tosses a new coin 10 times  3/10 heads
▫ Bob tosses the coin 10 times  4/10 heads
▫ Carol has watched them all  7/20 heads
• Probabilities in Monty Hall
▫ MC knows where the car is  1
▫ Guest asked again after MC opened the door  2/3
▫ Viewer started watching the show after MC opened the
door  1/2
Bayes Theorem
• Probability – P(A)
• Conditional Probability – P(A|C)
• P(A|B) = P(A,B)/P(B)
• P(B|A) = P(A,B)/P(A)
• P(A|B) = {P(B|A)P(A)}/P(B)
• P(C|D) = {P(D|C)P(C)}/P(D)
▫ P(C|D) : The probability of class given data (Posterior
Probability)
▫ P(C) : Prior Probability
▫ P(D|C) : Likelihood
▫ P(D) : constant, so ignored
Does patient have cancer or not?
• A patient takes a lab test and the result comes back positive. It
is known that the test returns a correct positive result in only
99% of the cases and a correct negative result in only 95% of t
he cases. Furthermore, only 0.03 of the entire population has
this disease.
1. What is the probability that this patient has cancer?
2. What is the probability that he does not have cancer?
3. What is the diagnosis?
Bayes Classifier
• Recall P(C|X1,X2,…Xn) =
P(C)P(X1,X2,…Xn|C)/P(X1,X2,…Xn)
•  P(C|X1,X2,…Xn) α P(C)P(X1,X2,…Xn|C)
• Maximum A Posteriori hypothesis
▫ hMAP = argmax P(D|h)P(h)
• Maximum Likelihood hypothesis
▫ hML = argmax P(D|h)
Naïve Bayes Classifier
• Recall P(C|X1,X2,…Xn) =
P(C)P(X1,X2,…Xn|C)/P(X1,X2,…Xn)
•  P(C|X1,X2,…Xn) α P(C)P(X1,X2,…Xn|C)
• It is hard to calculate joint probabilities
▫ Too many cases
▫ Too little data
• If we ignore the dependences among X1,X2,…Xn?
▫ Why? Because we are naïve.
▫ More precisely, suppose X1,X2,…Xn are conditionally
independent of each other given C
• P(C|X1,X2,…Xn) α P(C) * Π P(Xi|C)
Question: For the day <sunny, cool, high, strong>, what’s
the play prediction?
Wind
Humidity
Temp
Outlook
PlayP(Play=Y) 9/14
P(Play=N) 4/14
P(Sunny|P) P(Overcast|P) P(Rain|P)
Play=
Y
2/9 4/9 3/9
Play=
N
3/5 0/5 2/5
P(Hot|P) P(Mild|P) P(Cool|P)
Play=
Y
2/9 4/9 3/9
Play=
N
2/5 2/5 1/5
Zero Occurrence
• When a feature is never occurred in the training
set  zero frequency  PANIC: makes all terms
zero
• Smoothing the distribution
▫ Laplacian Smoothing
▫ Dirichlet Priors Smoothing
▫ and many more (Absolute Discouting, Jelinek-
Mercer smoothing, Katz smoothing, Good-Turing
smoothing, etc.)
Extension of NBC
• NBC is actually very effective
• Selective Bayesian Classifiers (SBC)
• Tree Augmented Naïve Bayes (TAN)
▫ ChowLiu algorithm (CL-TAN)
▫ SuperParent algorithm (SP-TAN)
• Attribute Value Taxonomy Guided Naïve Bayes
Learner (AVT-NBL)
• n-gram Augmented Naïve Bayes

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

Probability
ProbabilityProbability
Probability
 
Probability[1]
Probability[1]Probability[1]
Probability[1]
 
Bayes theorem
Bayes theoremBayes theorem
Bayes theorem
 
Nossi ch 10
Nossi ch 10Nossi ch 10
Nossi ch 10
 
Probability&Bayes theorem
Probability&Bayes theoremProbability&Bayes theorem
Probability&Bayes theorem
 
Probability & Bayesian Theorem
Probability & Bayesian TheoremProbability & Bayesian Theorem
Probability & Bayesian Theorem
 
Probability Concepts
Probability ConceptsProbability Concepts
Probability Concepts
 
Pre-Cal 40S June 1, 2009
Pre-Cal 40S June 1, 2009Pre-Cal 40S June 1, 2009
Pre-Cal 40S June 1, 2009
 
An introduction to Bayesian Statistics using Python
An introduction to Bayesian Statistics using PythonAn introduction to Bayesian Statistics using Python
An introduction to Bayesian Statistics using Python
 
Lecture on Statistics 1
Lecture on Statistics 1Lecture on Statistics 1
Lecture on Statistics 1
 
Counting
Counting  Counting
Counting
 
Introduction of Probability
Introduction of ProbabilityIntroduction of Probability
Introduction of Probability
 
Pre-Cal 40S Slides May 17, 2007
Pre-Cal 40S Slides May 17, 2007Pre-Cal 40S Slides May 17, 2007
Pre-Cal 40S Slides May 17, 2007
 
Complements conditional probability bayes theorem
Complements  conditional probability bayes theorem  Complements  conditional probability bayes theorem
Complements conditional probability bayes theorem
 
Formulas of Probability :Class 12 maths
Formulas of Probability :Class 12 mathsFormulas of Probability :Class 12 maths
Formulas of Probability :Class 12 maths
 
Probability By Ms Aarti
Probability By Ms AartiProbability By Ms Aarti
Probability By Ms Aarti
 
1616 probability-the foundation of probability theory
1616 probability-the foundation of probability theory1616 probability-the foundation of probability theory
1616 probability-the foundation of probability theory
 
Probability basics and bayes' theorem
Probability basics and bayes' theoremProbability basics and bayes' theorem
Probability basics and bayes' theorem
 
Probability
ProbabilityProbability
Probability
 
Conditional probability, and probability trees
Conditional probability, and probability treesConditional probability, and probability trees
Conditional probability, and probability trees
 

Andere mochten auch (6)

Lecture10 - Naïve Bayes
Lecture10 - Naïve BayesLecture10 - Naïve Bayes
Lecture10 - Naïve Bayes
 
An Overview of Naïve Bayes Classifier
An Overview of Naïve Bayes Classifier An Overview of Naïve Bayes Classifier
An Overview of Naïve Bayes Classifier
 
Naive bayes
Naive bayesNaive bayes
Naive bayes
 
Dwdm naive bayes_ankit_gadgil_027
Dwdm naive bayes_ankit_gadgil_027Dwdm naive bayes_ankit_gadgil_027
Dwdm naive bayes_ankit_gadgil_027
 
Naive bayes
Naive bayesNaive bayes
Naive bayes
 
Naive Bayes Presentation
Naive Bayes PresentationNaive Bayes Presentation
Naive Bayes Presentation
 

Ähnlich wie 2013-1 Machine Learning Lecture 03 - Naïve Bayes Classifiers

Probability 4.2
Probability 4.2Probability 4.2
Probability 4.2
herbison
 
Lecture_5Conditional_Probability_Bayes_T.pptx
Lecture_5Conditional_Probability_Bayes_T.pptxLecture_5Conditional_Probability_Bayes_T.pptx
Lecture_5Conditional_Probability_Bayes_T.pptx
Abebe334138
 

Ähnlich wie 2013-1 Machine Learning Lecture 03 - Naïve Bayes Classifiers (20)

Discrete PDs(1).pdf
Discrete PDs(1).pdfDiscrete PDs(1).pdf
Discrete PDs(1).pdf
 
2.statistical DEcision makig.pptx
2.statistical DEcision makig.pptx2.statistical DEcision makig.pptx
2.statistical DEcision makig.pptx
 
Probability 23321
Probability 23321Probability 23321
Probability 23321
 
Probability 23321
Probability 23321Probability 23321
Probability 23321
 
Probability
ProbabilityProbability
Probability
 
Probablity
ProbablityProbablity
Probablity
 
Bayes NIPT
Bayes NIPTBayes NIPT
Bayes NIPT
 
Probability Theory for Data Scientists
Probability Theory for Data ScientistsProbability Theory for Data Scientists
Probability Theory for Data Scientists
 
Probabilty1.pptx
Probabilty1.pptxProbabilty1.pptx
Probabilty1.pptx
 
Statistics 1 (FPN) QP
Statistics 1 (FPN) QPStatistics 1 (FPN) QP
Statistics 1 (FPN) QP
 
Probability 4.2
Probability 4.2Probability 4.2
Probability 4.2
 
5. RV and Distributions.pptx
5. RV and Distributions.pptx5. RV and Distributions.pptx
5. RV and Distributions.pptx
 
PROBABILITY THEORIES.pptx
PROBABILITY THEORIES.pptxPROBABILITY THEORIES.pptx
PROBABILITY THEORIES.pptx
 
Lec12-Probability (1).ppt
Lec12-Probability (1).pptLec12-Probability (1).ppt
Lec12-Probability (1).ppt
 
Lec12-Probability.ppt
Lec12-Probability.pptLec12-Probability.ppt
Lec12-Probability.ppt
 
Lec12-Probability.ppt
Lec12-Probability.pptLec12-Probability.ppt
Lec12-Probability.ppt
 
Lec12-Probability.ppt
Lec12-Probability.pptLec12-Probability.ppt
Lec12-Probability.ppt
 
Lecture_5Conditional_Probability_Bayes_T.pptx
Lecture_5Conditional_Probability_Bayes_T.pptxLecture_5Conditional_Probability_Bayes_T.pptx
Lecture_5Conditional_Probability_Bayes_T.pptx
 
Basic Probability Distribution
Basic Probability Distribution Basic Probability Distribution
Basic Probability Distribution
 
Ch7 gene disorders and pedigree analysis
Ch7 gene disorders and pedigree analysisCh7 gene disorders and pedigree analysis
Ch7 gene disorders and pedigree analysis
 

Mehr von Dongseo University

Mehr von Dongseo University (20)

Lecture_NaturalPolicyGradientsTRPOPPO.pdf
Lecture_NaturalPolicyGradientsTRPOPPO.pdfLecture_NaturalPolicyGradientsTRPOPPO.pdf
Lecture_NaturalPolicyGradientsTRPOPPO.pdf
 
Evolutionary Computation Lecture notes03
Evolutionary Computation Lecture notes03Evolutionary Computation Lecture notes03
Evolutionary Computation Lecture notes03
 
Evolutionary Computation Lecture notes02
Evolutionary Computation Lecture notes02Evolutionary Computation Lecture notes02
Evolutionary Computation Lecture notes02
 
Evolutionary Computation Lecture notes01
Evolutionary Computation Lecture notes01Evolutionary Computation Lecture notes01
Evolutionary Computation Lecture notes01
 
Markov Chain Monte Carlo
Markov Chain Monte CarloMarkov Chain Monte Carlo
Markov Chain Monte Carlo
 
Simplex Lecture Notes
Simplex Lecture NotesSimplex Lecture Notes
Simplex Lecture Notes
 
Reinforcement Learning
Reinforcement LearningReinforcement Learning
Reinforcement Learning
 
Median of Medians
Median of MediansMedian of Medians
Median of Medians
 
Average Linear Selection Algorithm
Average Linear Selection AlgorithmAverage Linear Selection Algorithm
Average Linear Selection Algorithm
 
Lower Bound of Comparison Sort
Lower Bound of Comparison SortLower Bound of Comparison Sort
Lower Bound of Comparison Sort
 
Running Time of Building Binary Heap using Array
Running Time of Building Binary Heap using ArrayRunning Time of Building Binary Heap using Array
Running Time of Building Binary Heap using Array
 
Running Time of MergeSort
Running Time of MergeSortRunning Time of MergeSort
Running Time of MergeSort
 
Binary Trees
Binary TreesBinary Trees
Binary Trees
 
Proof By Math Induction Example
Proof By Math Induction ExampleProof By Math Induction Example
Proof By Math Induction Example
 
TRPO and PPO notes
TRPO and PPO notesTRPO and PPO notes
TRPO and PPO notes
 
Estimating probability distributions
Estimating probability distributionsEstimating probability distributions
Estimating probability distributions
 
2018-2 Machine Learning (Wasserstein GAN and BEGAN)
2018-2 Machine Learning (Wasserstein GAN and BEGAN)2018-2 Machine Learning (Wasserstein GAN and BEGAN)
2018-2 Machine Learning (Wasserstein GAN and BEGAN)
 
2018-2 Machine Learning (Linear regression, Logistic regression)
2018-2 Machine Learning (Linear regression, Logistic regression)2018-2 Machine Learning (Linear regression, Logistic regression)
2018-2 Machine Learning (Linear regression, Logistic regression)
 
2017-2 ML W11 GAN #1
2017-2 ML W11 GAN #12017-2 ML W11 GAN #1
2017-2 ML W11 GAN #1
 
2017-2 ML W9 Reinforcement Learning #5
2017-2 ML W9 Reinforcement Learning #52017-2 ML W9 Reinforcement Learning #5
2017-2 ML W9 Reinforcement Learning #5
 

Kürzlich hochgeladen

Kürzlich hochgeladen (20)

How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
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
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.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
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Tatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsTatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf arts
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
latest AZ-104 Exam Questions and Answers
latest AZ-104 Exam Questions and Answerslatest AZ-104 Exam Questions and Answers
latest AZ-104 Exam Questions and Answers
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
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
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & Systems
 

2013-1 Machine Learning Lecture 03 - Naïve Bayes Classifiers

  • 2. Probability • What is the probability that you get hit in the head with bird droppings when you go outside? ▫ Initially shown in one episode of Korea TV show ▫ Asked in one BBS of an elite group in Korea  no one gave the right answer • It is difficult to define “probability” ▫ As difficult as defining “science”, “history”, etc. • 16 different definitions • Frequentist vs. Bayesian
  • 3. Bayesian Probability • Can assign probability on any statement • Can be used to show the degree of one’s belief, or degree of one’s knowledge. • Example of subjectiveness: Alice, Bob, and Carol ▫ Alice tosses a new coin 10 times  3/10 heads ▫ Bob tosses the coin 10 times  4/10 heads ▫ Carol has watched them all  7/20 heads • Probabilities in Monty Hall ▫ MC knows where the car is  1 ▫ Guest asked again after MC opened the door  2/3 ▫ Viewer started watching the show after MC opened the door  1/2
  • 4. Bayes Theorem • Probability – P(A) • Conditional Probability – P(A|C) • P(A|B) = P(A,B)/P(B) • P(B|A) = P(A,B)/P(A) • P(A|B) = {P(B|A)P(A)}/P(B) • P(C|D) = {P(D|C)P(C)}/P(D) ▫ P(C|D) : The probability of class given data (Posterior Probability) ▫ P(C) : Prior Probability ▫ P(D|C) : Likelihood ▫ P(D) : constant, so ignored
  • 5. Does patient have cancer or not? • A patient takes a lab test and the result comes back positive. It is known that the test returns a correct positive result in only 99% of the cases and a correct negative result in only 95% of t he cases. Furthermore, only 0.03 of the entire population has this disease. 1. What is the probability that this patient has cancer? 2. What is the probability that he does not have cancer? 3. What is the diagnosis?
  • 6. Bayes Classifier • Recall P(C|X1,X2,…Xn) = P(C)P(X1,X2,…Xn|C)/P(X1,X2,…Xn) •  P(C|X1,X2,…Xn) α P(C)P(X1,X2,…Xn|C) • Maximum A Posteriori hypothesis ▫ hMAP = argmax P(D|h)P(h) • Maximum Likelihood hypothesis ▫ hML = argmax P(D|h)
  • 7. Naïve Bayes Classifier • Recall P(C|X1,X2,…Xn) = P(C)P(X1,X2,…Xn|C)/P(X1,X2,…Xn) •  P(C|X1,X2,…Xn) α P(C)P(X1,X2,…Xn|C) • It is hard to calculate joint probabilities ▫ Too many cases ▫ Too little data • If we ignore the dependences among X1,X2,…Xn? ▫ Why? Because we are naïve. ▫ More precisely, suppose X1,X2,…Xn are conditionally independent of each other given C • P(C|X1,X2,…Xn) α P(C) * Π P(Xi|C)
  • 8. Question: For the day <sunny, cool, high, strong>, what’s the play prediction?
  • 9. Wind Humidity Temp Outlook PlayP(Play=Y) 9/14 P(Play=N) 4/14 P(Sunny|P) P(Overcast|P) P(Rain|P) Play= Y 2/9 4/9 3/9 Play= N 3/5 0/5 2/5 P(Hot|P) P(Mild|P) P(Cool|P) Play= Y 2/9 4/9 3/9 Play= N 2/5 2/5 1/5
  • 10. Zero Occurrence • When a feature is never occurred in the training set  zero frequency  PANIC: makes all terms zero • Smoothing the distribution ▫ Laplacian Smoothing ▫ Dirichlet Priors Smoothing ▫ and many more (Absolute Discouting, Jelinek- Mercer smoothing, Katz smoothing, Good-Turing smoothing, etc.)
  • 11. Extension of NBC • NBC is actually very effective • Selective Bayesian Classifiers (SBC) • Tree Augmented Naïve Bayes (TAN) ▫ ChowLiu algorithm (CL-TAN) ▫ SuperParent algorithm (SP-TAN) • Attribute Value Taxonomy Guided Naïve Bayes Learner (AVT-NBL) • n-gram Augmented Naïve Bayes