SlideShare a Scribd company logo
Bayes Classification
By
SATHISHKUMAR G
(sathishsak111@gmail.com)
 Uncertainty & Probability
 Baye's rule
 Choosing Hypotheses- Maximum a posteriori
 Maximum Likelihood - Baye's concept learning
 Maximum Likelihood of real valued function
 Bayes optimal Classifier
 Joint distributions
 Naive Bayes Classifier
classification
Uncertainty
 Our main tool is the probability theory, which
assigns to each sentence numerical degree of
belief between 0 and 1
 It provides a way of summarizing the
uncertainty
Variables
 Boolean random variables: cavity might be true or false
 Discrete random variables: weather might be sunny, rainy,
cloudy, snow
 P(Weather=sunny)
 P(Weather=rainy)
 P(Weather=cloudy)
 P(Weather=snow)
 Continuous random variables: the temperature has continuous
values
Where do probabilities come
from?
 Frequents:
 From experiments: form any finite sample, we can estimate the true
fraction and also calculate how accurate our estimation is likely to be
 Subjective:
 Agent’s believe
 Objectivist:
 True nature of the universe, that the probability up heads with
probability 0.5 is a probability of the coin
 Before the evidence is obtained; prior probability
 P(a) the prior probability that the proposition is true
 P(cavity)=0.1
 After the evidence is obtained; posterior probability
 P(a|b)
 The probability of a given that all we know is b
 P(cavity|toothache)=0.8
Axioms of Probability
(Kolmogorov’s axioms,
first published in German 1933)
 All probabilities are between 0 and 1. For any
proposition a 0 P(a) 1≤ ≤
 P(true)=1, P(false)=0
 The probability of disjunction is given by
P(a∨b)=P(a)+P(b)−P(a∧b)
Zur Anzeige wird der QuickTime™
Dekompressor „TIFF (Unkomprimiert)“
benötigt.
 Product rule
)()|()(
)()|()(
aPabPbaP
bPbaPbaP
=∧
=∧
Theorem of total probability
If events A1, ... , An are mutually
exclusive with then
Bayes’s rule
 (Reverent Thomas Bayes 1702-1761)
• He set down his findings on
probability in "Essay Towards
Solving a Problem in the Doctrine of
Chances" (1763), published
posthumously in the Philosophical
Transactions of the Royal Society of
London
P(b|a)=
P(a|b)P(b)
P(a)
Zur Anzeige wird der QuickTime™
Dekompressor „TIFF (LZW)“
benötigt.
Diagnosis
 What is the probability of meningitis in the patient with stiff
neck?
 A doctor knows that the disease meningitis causes the patient to have
a stiff neck in 50% of the time -> P(s|m)
 Prior Probabilities:
• That the patient has meningitis is 1/50.000 -> P(m)
• That the patient has a stiff neck is 1/20 -> P(s)
P(m|s)=
0.5*0.00002
0.05
=0.0002
P(m|s)=
P(s|m)P(m)
P(s)
Normalization

)(
)()|(
)|(
)(
)()|(
)|(
xP
yPyxP
xyP
xP
yPyxP
xyP
¬¬
=¬
=
4.0,6.008.0,12.0
)|(),|(
)()|()|(
)|()|(1
=
¬
×=
¬+=
α
α
α
xyPxyP
YPYXPXYP
xyPxyP
Bayes Theorem
 P(h) = prior probability of hypothesis h
 P(D) = prior probability of training data D
 P(h|D) = probability of h given D
 P(D|h) = probability of D given h
Choosing Hypotheses
 Generally want the most probable
hypothesis given the training data
 Maximum a posteriori hypothesis hMAP:

 If assume P(hi)=P(hj) for all hi and hj, then
can further simplify, and choose the
 Maximum likelihood (ML) hypothesis
Example
 Does patient have cancer or not?
A patient takes a lab test and the result comes
back positive. The test returns a correct
positive result (+) in only 98% of the cases in
which the disease is actually present, and a
correct negative result (-) in only 97% of the
cases in which the disease is not present
Furthermore, 0.008 of the entire population have
this cancer
Suppose a positive result (+) is
returned...

Normalization
 The result of Bayesian inference depends
strongly on the prior probabilities, which
must be available in order to apply the
method
0.0078
0.0078+0.0298
=0.20745
0.0298
0.0078+0.0298
=0.79255
Brute-Force
Bayes Concept Learning
 For each hypothesis h in H, calculate the
posterior probability
 Output the hypothesis hMAP with the highest
posterior probability
 Given no prior knowledge that one
hypothesis is more likely than another,
what values should we specify for P(h)?
 What choice shall we make for P(D|h) ?
 Choose P(h) to be uniform distribution
 for all h in H
 P(D|h)=1 if h consistent with D
 P(D|h)=0 otherwise
P(D)
 Version space VSH,D is the subset of consistent
Hypotheses from H with the training examples in D
P(D)= P(D|hi
hi ∈H
∑ )P(hi)
P(D)= 1⋅
1
|H|hi ∈VSH,D
∑ + 0⋅
1
|H|hi ∉VSH,D
∑
P(D)=
|VSH,D|
|H|
P(h|D)=
1⋅
1
|H|
|VSH,D |
|H|
=
1
|VSH,D |
if h is inconsistent with D
if h is consistent with D

Maximum Likelihood of real
valued function
 Maximize natural log of this instead...
Bayes optimal Classifier
A weighted majority classifier
 What is he most probable classification of the new
instance given the training data?
 The most probable classification of the new instance is
obtained by combining the prediction of all hypothesis,
weighted by their posterior probabilities
 If the classification of new example can take any
value vj from some set V, then the probability P(vj|D)
that the correct classification for the new instance is
vj, is just:
Bayes optimal classification:

Gibbs Algorithm
 Bayes optimal classifier provides best
result, but can be expensive if many
hypotheses
 Gibbs algorithm:
 Choose one hypothesis at random, according
to P(h|D)
 Use this to classify new instance
 Suppose correct, uniform prior distribution
over H, then
 Pick any hypothesis at random..
 Its expected error no worse than twice Bayes
optimal
Joint distribution
 A joint distribution for toothache, cavity, catch, dentist‘s probe
catches in my tooth :-(
 We need to know the conditional probabilities of the conjunction
of toothache and cavity
 What can a dentist conclude if the probe catches in the aching
tooth?
 For n possible variables there are 2n
possible combinations
Z u rA n z e ig e w ird d e rQu ic k T ime ™
D e k o mp re s s o r„T IF F (L Z W)“
b e n ö tig t.
P(cavity|toothache∧catch)=
P(toothache∧catch|cavity)P(cavity)
P(toothache∧cavity)
Conditional Independence
 Once we know that the patient has cavity we do
not expect the probability of the probe catching to
depend on the presence of toothache
 Independence between a and b
)|()|(
)|()|(
cavitytoothachePcatchcavitytoothacheP
cavitycatchPtoothachecavitycatchP
=∧
=∧
)()|(
)()|(
bPabP
aPbaP
=
=
• The decomposition of large probabilistic domains into
weakly connected subsets via conditional
independence is one of the most important
developments in the recent history of AI
• This can work well, even the assumption is not true!
),,()(
),,,(
)()()(
cavitycatchtoothachePcloudyWeatherP
cloudyWeathercavitycatchtoothacheP
bPaPbaP
==
==
=∧
A single cause directly influence a number of
effects, all of which are conditionally
independent
)|()(),...,,(
1
21 causeeffectPcausePeffecteffecteffectcauseP
n
i
in ∏=
=
Naive Bayes Classifier
 Along with decision trees, neural networks,
nearest nbr, one of the most practical learning
methods
 When to use:
 Moderate or large training set available
 Attributes that describe instances are conditionally
independent given classification
 Successful applications:
 Diagnosis
 Classifying text documents
Naive Bayes Classifier
 Assume target function f: X  V, where
each instance x described by attributes a1,
a2 .. an
 Most probable value of f(x) is:
vNB
 Naive Bayes assumption:
 which gives
Naive Bayes Algorithm
 For each target value vj
  estimate P(vj)
 For each attribute value ai of each
attribute a
  estimate P(ai|vj)
Training dataset
age income student credit_rating buys_computer
<=30 high no fair no
<=30 high no excellent no
30…40 high no fair yes
>40 medium no fair yes
>40 low yes fair yes
>40 low yes excellent no
31…40 low yes excellent yes
<=30 medium no fair no
<=30 low yes fair yes
>40 medium yes fair yes
<=30 medium yes excellent yes
31…40 medium no excellent yes
31…40 high yes fair yes
>40 medium no excellent no
Class:
C1:buys_computer=‘yes’
C2:buys_computer=‘no’
Data sample:
X =
(age<=30,
Income=medium,
Student=yes
Credit_rating=Fair)
Naï ve Bayesian Classifier:
Example
 Compute P(X|Ci) for each class
P(age=“<30” | buys_computer=“yes”) = 2/9=0.222
P(age=“<30” | buys_computer=“no”) = 3/5 =0.6
P(income=“medium” | buys_computer=“yes”)= 4/9 =0.444
P(income=“medium” | buys_computer=“no”) = 2/5 = 0.4
P(student=“yes” | buys_computer=“yes)= 6/9 =0.667
P(student=“yes” | buys_computer=“no”)= 1/5=0.2
P(credit_rating=“fair” | buys_computer=“yes”)=6/9=0.667
P(credit_rating=“fair” | buys_computer=“no”)=2/5=0.4
 X=(age<=30 ,income =medium, student=yes,credit_rating=fair)
P(X|Ci) : P(X|buys_computer=“yes”)= 0.222 x 0.444 x 0.667 x
0.0.667 =0.044
P(X|buys_computer=“no”)= 0.6 x 0.4 x 0.2 x 0.4 =0.019
P(X|Ci)*P(Ci ) : P(X|buys_computer=“yes”) * P(buys_computer=“yes”)=0.028
P(X|buys_computer=“no”) * P(buys_computer=“no”)=0.007
P(buys_computer=„yes“)=9/14
P(buys_computer=„no“)=5/14
 Conditional independence assumption is
often violated
 ...but it works surprisingly well anyway
Estimating Probabilities
 We have estimated probabilities by the fraction
of times the event is observed to nc occur over
the total number of opportunities n
 It provides poor estimates when nc is very small
 If none of the training instances with target
value vj have attribute value ai?
 nc is 0
 When nc is very small:
 n is number of training examples for which v=vj
 nc number of examples for which v=vj and a=ai
 p is prior estimate
 m is weight given to prior (i.e. number of
``virtual'' examples)
Naï ve Bayesian Classifier:
Comments
 Advantages :
 Easy to implement
 Good results obtained in most of the cases
 Disadvantages
 Assumption: class conditional independence , therefore loss of
accuracy
 Practically, dependencies exist among variables
 E.g., hospitals: patients: Profile: age, family history etc
Symptoms: fever, cough etc., Disease: lung cancer, diabetes etc
 Dependencies among these cannot be modeled by Naï ve
Bayesian Classifier
 How to deal with these dependencies?
 Bayesian Belief Networks
 Uncertainty & Probability
 Baye's rule
 Choosing Hypotheses- Maximum a posteriori
 Maximum Likelihood - Baye's concept learning
 Maximum Likelihood of real valued function
 Bayes optimal Classifier
 Joint distributions
 Naive Bayes Classifier
Bayesian Belief Networks
Burglary
P(B)
0.001
Earthquake P(E)
0.002
Alarm
Burg. Earth. P(A)
t t .95
t f .94
f t .29
f f .001
JohnCalls MaryCalls
A P(J)
t .90
f .05
A P(M)
t .7
f .01
Thank you

More Related Content

What's hot

Bias and variance trade off
Bias and variance trade offBias and variance trade off
Bias and variance trade off
VARUN KUMAR
 
Classification Based Machine Learning Algorithms
Classification Based Machine Learning AlgorithmsClassification Based Machine Learning Algorithms
Classification Based Machine Learning Algorithms
Md. Main Uddin Rony
 
Instance Based Learning in Machine Learning
Instance Based Learning in Machine LearningInstance Based Learning in Machine Learning
Instance Based Learning in Machine Learning
Pavithra Thippanaik
 
Linear regression
Linear regressionLinear regression
Linear regression
MartinHogg9
 
Data Mining: Concepts and Techniques (3rd ed.) - Chapter 3 preprocessing
Data Mining:  Concepts and Techniques (3rd ed.)- Chapter 3 preprocessingData Mining:  Concepts and Techniques (3rd ed.)- Chapter 3 preprocessing
Data Mining: Concepts and Techniques (3rd ed.) - Chapter 3 preprocessing
Salah Amean
 
Naive Bayes
Naive BayesNaive Bayes
Naive Bayes
CloudxLab
 
PAC Learning
PAC LearningPAC Learning
PAC Learning
Sanghyuk Chun
 
K mean-clustering algorithm
K mean-clustering algorithmK mean-clustering algorithm
K mean-clustering algorithm
parry prabhu
 
Mining Frequent Patterns, Association and Correlations
Mining Frequent Patterns, Association and CorrelationsMining Frequent Patterns, Association and Correlations
Mining Frequent Patterns, Association and Correlations
Justin Cletus
 
lecture 30
lecture 30lecture 30
lecture 30sajinsc
 
Data Preprocessing
Data PreprocessingData Preprocessing
Bayesian networks
Bayesian networksBayesian networks
Bayesian networks
Massimiliano Patacchiola
 
Dempster shafer theory
Dempster shafer theoryDempster shafer theory
Dempster shafer theory
Dr. C.V. Suresh Babu
 
Markov Random Field (MRF)
Markov Random Field (MRF)Markov Random Field (MRF)
Association Analysis in Data Mining
Association Analysis in Data MiningAssociation Analysis in Data Mining
Association Analysis in Data Mining
Kamal Acharya
 
Curse of dimensionality
Curse of dimensionalityCurse of dimensionality
Curse of dimensionalityNikhil Sharma
 
Perceptron (neural network)
Perceptron (neural network)Perceptron (neural network)
Perceptron (neural network)
EdutechLearners
 
Performance Metrics for Machine Learning Algorithms
Performance Metrics for Machine Learning AlgorithmsPerformance Metrics for Machine Learning Algorithms
Performance Metrics for Machine Learning Algorithms
Kush Kulshrestha
 

What's hot (20)

Bias and variance trade off
Bias and variance trade offBias and variance trade off
Bias and variance trade off
 
Classification Based Machine Learning Algorithms
Classification Based Machine Learning AlgorithmsClassification Based Machine Learning Algorithms
Classification Based Machine Learning Algorithms
 
Instance Based Learning in Machine Learning
Instance Based Learning in Machine LearningInstance Based Learning in Machine Learning
Instance Based Learning in Machine Learning
 
Linear regression
Linear regressionLinear regression
Linear regression
 
Concept learning
Concept learningConcept learning
Concept learning
 
Data Mining: Concepts and Techniques (3rd ed.) - Chapter 3 preprocessing
Data Mining:  Concepts and Techniques (3rd ed.)- Chapter 3 preprocessingData Mining:  Concepts and Techniques (3rd ed.)- Chapter 3 preprocessing
Data Mining: Concepts and Techniques (3rd ed.) - Chapter 3 preprocessing
 
Naive Bayes
Naive BayesNaive Bayes
Naive Bayes
 
PAC Learning
PAC LearningPAC Learning
PAC Learning
 
K mean-clustering algorithm
K mean-clustering algorithmK mean-clustering algorithm
K mean-clustering algorithm
 
Mining Frequent Patterns, Association and Correlations
Mining Frequent Patterns, Association and CorrelationsMining Frequent Patterns, Association and Correlations
Mining Frequent Patterns, Association and Correlations
 
lecture 30
lecture 30lecture 30
lecture 30
 
Data Preprocessing
Data PreprocessingData Preprocessing
Data Preprocessing
 
Bayesian networks
Bayesian networksBayesian networks
Bayesian networks
 
Dempster shafer theory
Dempster shafer theoryDempster shafer theory
Dempster shafer theory
 
Markov Random Field (MRF)
Markov Random Field (MRF)Markov Random Field (MRF)
Markov Random Field (MRF)
 
Association Analysis in Data Mining
Association Analysis in Data MiningAssociation Analysis in Data Mining
Association Analysis in Data Mining
 
Curse of dimensionality
Curse of dimensionalityCurse of dimensionality
Curse of dimensionality
 
Ontology engineering
Ontology engineering Ontology engineering
Ontology engineering
 
Perceptron (neural network)
Perceptron (neural network)Perceptron (neural network)
Perceptron (neural network)
 
Performance Metrics for Machine Learning Algorithms
Performance Metrics for Machine Learning AlgorithmsPerformance Metrics for Machine Learning Algorithms
Performance Metrics for Machine Learning Algorithms
 

Similar to Bayes Classification

Bayesian statistics
Bayesian statisticsBayesian statistics
Bayesian statistics
Alberto Labarga
 
Probabilistic Reasoning
Probabilistic ReasoningProbabilistic Reasoning
Probabilistic ReasoningTameem Ahmad
 
Unit IV UNCERTAINITY AND STATISTICAL REASONING in AI K.Sundar,AP/CSE,VEC
Unit IV UNCERTAINITY AND STATISTICAL REASONING in AI K.Sundar,AP/CSE,VECUnit IV UNCERTAINITY AND STATISTICAL REASONING in AI K.Sundar,AP/CSE,VEC
Unit IV UNCERTAINITY AND STATISTICAL REASONING in AI K.Sundar,AP/CSE,VEC
sundarKanagaraj1
 
NB classifier to use your next exam aslo
NB classifier to use your next exam asloNB classifier to use your next exam aslo
NB classifier to use your next exam aslo
kuntalpatra420
 
NB classifier_Detailed pdf you can use it
NB classifier_Detailed pdf you can use itNB classifier_Detailed pdf you can use it
NB classifier_Detailed pdf you can use it
kuntalpatra420
 
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
freshdatabos
 
Equational axioms for probability calculus and modelling of Likelihood ratio ...
Equational axioms for probability calculus and modelling of Likelihood ratio ...Equational axioms for probability calculus and modelling of Likelihood ratio ...
Equational axioms for probability calculus and modelling of Likelihood ratio ...
Advanced-Concepts-Team
 
Probability Theory.pdf
Probability Theory.pdfProbability Theory.pdf
Probability Theory.pdf
codewithmensah
 
Probability cheatsheet
Probability cheatsheetProbability cheatsheet
Probability cheatsheet
Joachim Gwoke
 
Probability Cheatsheet.pdf
Probability Cheatsheet.pdfProbability Cheatsheet.pdf
Probability Cheatsheet.pdf
ChinmayeeJonnalagadd2
 
Naive Bayes Presentation
Naive Bayes PresentationNaive Bayes Presentation
Naive Bayes Presentation
Md. Enamul Haque Chowdhury
 
PTSP PPT.pdf
PTSP PPT.pdfPTSP PPT.pdf
PTSP PPT.pdf
goutamkrsahoo
 
ISBA 2016: Foundations
ISBA 2016: FoundationsISBA 2016: Foundations
ISBA 2016: Foundations
Christian Robert
 
original
originaloriginal
originalbutest
 

Similar to Bayes Classification (20)

Bayesian statistics
Bayesian statisticsBayesian statistics
Bayesian statistics
 
Uncertainty
UncertaintyUncertainty
Uncertainty
 
Probabilistic Reasoning
Probabilistic ReasoningProbabilistic Reasoning
Probabilistic Reasoning
 
Unit IV UNCERTAINITY AND STATISTICAL REASONING in AI K.Sundar,AP/CSE,VEC
Unit IV UNCERTAINITY AND STATISTICAL REASONING in AI K.Sundar,AP/CSE,VECUnit IV UNCERTAINITY AND STATISTICAL REASONING in AI K.Sundar,AP/CSE,VEC
Unit IV UNCERTAINITY AND STATISTICAL REASONING in AI K.Sundar,AP/CSE,VEC
 
NB classifier to use your next exam aslo
NB classifier to use your next exam asloNB classifier to use your next exam aslo
NB classifier to use your next exam aslo
 
NB classifier_Detailed pdf you can use it
NB classifier_Detailed pdf you can use itNB classifier_Detailed pdf you can use it
NB classifier_Detailed pdf you can use it
 
Uncertainity
Uncertainity Uncertainity
Uncertainity
 
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
 
Bayes Theorem
Bayes TheoremBayes Theorem
Bayes Theorem
 
Equational axioms for probability calculus and modelling of Likelihood ratio ...
Equational axioms for probability calculus and modelling of Likelihood ratio ...Equational axioms for probability calculus and modelling of Likelihood ratio ...
Equational axioms for probability calculus and modelling of Likelihood ratio ...
 
Probability Theory.pdf
Probability Theory.pdfProbability Theory.pdf
Probability Theory.pdf
 
Probability cheatsheet
Probability cheatsheetProbability cheatsheet
Probability cheatsheet
 
Probability Cheatsheet.pdf
Probability Cheatsheet.pdfProbability Cheatsheet.pdf
Probability Cheatsheet.pdf
 
Naive Bayes Presentation
Naive Bayes PresentationNaive Bayes Presentation
Naive Bayes Presentation
 
PTSP PPT.pdf
PTSP PPT.pdfPTSP PPT.pdf
PTSP PPT.pdf
 
Kul Wedsem Presentation
Kul Wedsem PresentationKul Wedsem Presentation
Kul Wedsem Presentation
 
ISBA 2016: Foundations
ISBA 2016: FoundationsISBA 2016: Foundations
ISBA 2016: Foundations
 
original
originaloriginal
original
 
Lecture3
Lecture3Lecture3
Lecture3
 
Bayes 6
Bayes 6Bayes 6
Bayes 6
 

More from sathish sak

TRANSPARENT CONCRE
TRANSPARENT CONCRETRANSPARENT CONCRE
TRANSPARENT CONCRE
sathish sak
 
Stationary Waves
Stationary WavesStationary Waves
Stationary Waves
sathish sak
 
Electrical Activity of the Heart
Electrical Activity of the HeartElectrical Activity of the Heart
Electrical Activity of the Heart
sathish sak
 
Electrical Activity of the Heart
Electrical Activity of the HeartElectrical Activity of the Heart
Electrical Activity of the Heart
sathish sak
 
Software process life cycles
Software process life cyclesSoftware process life cycles
Software process life cycles
sathish sak
 
Digital Logic Circuits
Digital Logic CircuitsDigital Logic Circuits
Digital Logic Circuits
sathish sak
 
Real-Time Scheduling
Real-Time SchedulingReal-Time Scheduling
Real-Time Scheduling
sathish sak
 
Real-Time Signal Processing: Implementation and Application
Real-Time Signal Processing:  Implementation and ApplicationReal-Time Signal Processing:  Implementation and Application
Real-Time Signal Processing: Implementation and Application
sathish sak
 
DIGITAL SIGNAL PROCESSOR OVERVIEW
DIGITAL SIGNAL PROCESSOR OVERVIEWDIGITAL SIGNAL PROCESSOR OVERVIEW
DIGITAL SIGNAL PROCESSOR OVERVIEW
sathish sak
 
FRACTAL ROBOTICS
FRACTAL  ROBOTICSFRACTAL  ROBOTICS
FRACTAL ROBOTICS
sathish sak
 
Electro bike
Electro bikeElectro bike
Electro bike
sathish sak
 
ROBOTIC SURGERY
ROBOTIC SURGERYROBOTIC SURGERY
ROBOTIC SURGERY
sathish sak
 
POWER GENERATION OF THERMAL POWER PLANT
POWER GENERATION OF THERMAL POWER PLANTPOWER GENERATION OF THERMAL POWER PLANT
POWER GENERATION OF THERMAL POWER PLANT
sathish sak
 
mathematics application fiels of engineering
mathematics application fiels of engineeringmathematics application fiels of engineering
mathematics application fiels of engineering
sathish sak
 
Plastics…
Plastics…Plastics…
Plastics…
sathish sak
 
ENGINEERING
ENGINEERINGENGINEERING
ENGINEERING
sathish sak
 
ENVIRONMENTAL POLLUTION
ENVIRONMENTALPOLLUTIONENVIRONMENTALPOLLUTION
ENVIRONMENTAL POLLUTION
sathish sak
 
RFID TECHNOLOGY
RFID TECHNOLOGYRFID TECHNOLOGY
RFID TECHNOLOGY
sathish sak
 
green chemistry
green chemistrygreen chemistry
green chemistry
sathish sak
 
NANOTECHNOLOGY
  NANOTECHNOLOGY	  NANOTECHNOLOGY
NANOTECHNOLOGY
sathish sak
 

More from sathish sak (20)

TRANSPARENT CONCRE
TRANSPARENT CONCRETRANSPARENT CONCRE
TRANSPARENT CONCRE
 
Stationary Waves
Stationary WavesStationary Waves
Stationary Waves
 
Electrical Activity of the Heart
Electrical Activity of the HeartElectrical Activity of the Heart
Electrical Activity of the Heart
 
Electrical Activity of the Heart
Electrical Activity of the HeartElectrical Activity of the Heart
Electrical Activity of the Heart
 
Software process life cycles
Software process life cyclesSoftware process life cycles
Software process life cycles
 
Digital Logic Circuits
Digital Logic CircuitsDigital Logic Circuits
Digital Logic Circuits
 
Real-Time Scheduling
Real-Time SchedulingReal-Time Scheduling
Real-Time Scheduling
 
Real-Time Signal Processing: Implementation and Application
Real-Time Signal Processing:  Implementation and ApplicationReal-Time Signal Processing:  Implementation and Application
Real-Time Signal Processing: Implementation and Application
 
DIGITAL SIGNAL PROCESSOR OVERVIEW
DIGITAL SIGNAL PROCESSOR OVERVIEWDIGITAL SIGNAL PROCESSOR OVERVIEW
DIGITAL SIGNAL PROCESSOR OVERVIEW
 
FRACTAL ROBOTICS
FRACTAL  ROBOTICSFRACTAL  ROBOTICS
FRACTAL ROBOTICS
 
Electro bike
Electro bikeElectro bike
Electro bike
 
ROBOTIC SURGERY
ROBOTIC SURGERYROBOTIC SURGERY
ROBOTIC SURGERY
 
POWER GENERATION OF THERMAL POWER PLANT
POWER GENERATION OF THERMAL POWER PLANTPOWER GENERATION OF THERMAL POWER PLANT
POWER GENERATION OF THERMAL POWER PLANT
 
mathematics application fiels of engineering
mathematics application fiels of engineeringmathematics application fiels of engineering
mathematics application fiels of engineering
 
Plastics…
Plastics…Plastics…
Plastics…
 
ENGINEERING
ENGINEERINGENGINEERING
ENGINEERING
 
ENVIRONMENTAL POLLUTION
ENVIRONMENTALPOLLUTIONENVIRONMENTALPOLLUTION
ENVIRONMENTAL POLLUTION
 
RFID TECHNOLOGY
RFID TECHNOLOGYRFID TECHNOLOGY
RFID TECHNOLOGY
 
green chemistry
green chemistrygreen chemistry
green chemistry
 
NANOTECHNOLOGY
  NANOTECHNOLOGY	  NANOTECHNOLOGY
NANOTECHNOLOGY
 

Recently uploaded

First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
Globus
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
Fermin Galan
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
Drona Infotech
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
Hornet Dynamics
 
AI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website CreatorAI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website Creator
Google
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
Globus
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
Boni García
 
Enterprise Software Development with No Code Solutions.pptx
Enterprise Software Development with No Code Solutions.pptxEnterprise Software Development with No Code Solutions.pptx
Enterprise Software Development with No Code Solutions.pptx
QuickwayInfoSystems3
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
Łukasz Chruściel
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
Neo4j
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Globus
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
Paco van Beckhoven
 
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptxText-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
ShamsuddeenMuhammadA
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
Aftab Hussain
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
Google
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
XfilesPro
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
Aftab Hussain
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
rickgrimesss22
 

Recently uploaded (20)

First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
 
AI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website CreatorAI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website Creator
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
 
Enterprise Software Development with No Code Solutions.pptx
Enterprise Software Development with No Code Solutions.pptxEnterprise Software Development with No Code Solutions.pptx
Enterprise Software Development with No Code Solutions.pptx
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
 
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptxText-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
 

Bayes Classification

  • 2.  Uncertainty & Probability  Baye's rule  Choosing Hypotheses- Maximum a posteriori  Maximum Likelihood - Baye's concept learning  Maximum Likelihood of real valued function  Bayes optimal Classifier  Joint distributions  Naive Bayes Classifier classification
  • 3. Uncertainty  Our main tool is the probability theory, which assigns to each sentence numerical degree of belief between 0 and 1  It provides a way of summarizing the uncertainty
  • 4. Variables  Boolean random variables: cavity might be true or false  Discrete random variables: weather might be sunny, rainy, cloudy, snow  P(Weather=sunny)  P(Weather=rainy)  P(Weather=cloudy)  P(Weather=snow)  Continuous random variables: the temperature has continuous values
  • 5. Where do probabilities come from?  Frequents:  From experiments: form any finite sample, we can estimate the true fraction and also calculate how accurate our estimation is likely to be  Subjective:  Agent’s believe  Objectivist:  True nature of the universe, that the probability up heads with probability 0.5 is a probability of the coin
  • 6.  Before the evidence is obtained; prior probability  P(a) the prior probability that the proposition is true  P(cavity)=0.1  After the evidence is obtained; posterior probability  P(a|b)  The probability of a given that all we know is b  P(cavity|toothache)=0.8
  • 7. Axioms of Probability (Kolmogorov’s axioms, first published in German 1933)  All probabilities are between 0 and 1. For any proposition a 0 P(a) 1≤ ≤  P(true)=1, P(false)=0  The probability of disjunction is given by P(a∨b)=P(a)+P(b)−P(a∧b) Zur Anzeige wird der QuickTime™ Dekompressor „TIFF (Unkomprimiert)“ benötigt.
  • 9. Theorem of total probability If events A1, ... , An are mutually exclusive with then
  • 10. Bayes’s rule  (Reverent Thomas Bayes 1702-1761) • He set down his findings on probability in "Essay Towards Solving a Problem in the Doctrine of Chances" (1763), published posthumously in the Philosophical Transactions of the Royal Society of London P(b|a)= P(a|b)P(b) P(a) Zur Anzeige wird der QuickTime™ Dekompressor „TIFF (LZW)“ benötigt.
  • 11. Diagnosis  What is the probability of meningitis in the patient with stiff neck?  A doctor knows that the disease meningitis causes the patient to have a stiff neck in 50% of the time -> P(s|m)  Prior Probabilities: • That the patient has meningitis is 1/50.000 -> P(m) • That the patient has a stiff neck is 1/20 -> P(s) P(m|s)= 0.5*0.00002 0.05 =0.0002 P(m|s)= P(s|m)P(m) P(s)
  • 13. Bayes Theorem  P(h) = prior probability of hypothesis h  P(D) = prior probability of training data D  P(h|D) = probability of h given D  P(D|h) = probability of D given h
  • 14. Choosing Hypotheses  Generally want the most probable hypothesis given the training data  Maximum a posteriori hypothesis hMAP:
  • 15.
  • 16.  If assume P(hi)=P(hj) for all hi and hj, then can further simplify, and choose the  Maximum likelihood (ML) hypothesis
  • 17. Example  Does patient have cancer or not? A patient takes a lab test and the result comes back positive. The test returns a correct positive result (+) in only 98% of the cases in which the disease is actually present, and a correct negative result (-) in only 97% of the cases in which the disease is not present Furthermore, 0.008 of the entire population have this cancer
  • 18. Suppose a positive result (+) is returned... 
  • 19. Normalization  The result of Bayesian inference depends strongly on the prior probabilities, which must be available in order to apply the method 0.0078 0.0078+0.0298 =0.20745 0.0298 0.0078+0.0298 =0.79255
  • 20. Brute-Force Bayes Concept Learning  For each hypothesis h in H, calculate the posterior probability  Output the hypothesis hMAP with the highest posterior probability
  • 21.  Given no prior knowledge that one hypothesis is more likely than another, what values should we specify for P(h)?  What choice shall we make for P(D|h) ?
  • 22.  Choose P(h) to be uniform distribution  for all h in H  P(D|h)=1 if h consistent with D  P(D|h)=0 otherwise
  • 23. P(D)  Version space VSH,D is the subset of consistent Hypotheses from H with the training examples in D P(D)= P(D|hi hi ∈H ∑ )P(hi) P(D)= 1⋅ 1 |H|hi ∈VSH,D ∑ + 0⋅ 1 |H|hi ∉VSH,D ∑ P(D)= |VSH,D| |H|
  • 24. P(h|D)= 1⋅ 1 |H| |VSH,D | |H| = 1 |VSH,D | if h is inconsistent with D if h is consistent with D
  • 25.
  • 26. Maximum Likelihood of real valued function
  • 27.  Maximize natural log of this instead...
  • 28. Bayes optimal Classifier A weighted majority classifier  What is he most probable classification of the new instance given the training data?  The most probable classification of the new instance is obtained by combining the prediction of all hypothesis, weighted by their posterior probabilities  If the classification of new example can take any value vj from some set V, then the probability P(vj|D) that the correct classification for the new instance is vj, is just:
  • 30. Gibbs Algorithm  Bayes optimal classifier provides best result, but can be expensive if many hypotheses  Gibbs algorithm:  Choose one hypothesis at random, according to P(h|D)  Use this to classify new instance
  • 31.  Suppose correct, uniform prior distribution over H, then  Pick any hypothesis at random..  Its expected error no worse than twice Bayes optimal
  • 32. Joint distribution  A joint distribution for toothache, cavity, catch, dentist‘s probe catches in my tooth :-(  We need to know the conditional probabilities of the conjunction of toothache and cavity  What can a dentist conclude if the probe catches in the aching tooth?  For n possible variables there are 2n possible combinations Z u rA n z e ig e w ird d e rQu ic k T ime ™ D e k o mp re s s o r„T IF F (L Z W)“ b e n ö tig t. P(cavity|toothache∧catch)= P(toothache∧catch|cavity)P(cavity) P(toothache∧cavity)
  • 33. Conditional Independence  Once we know that the patient has cavity we do not expect the probability of the probe catching to depend on the presence of toothache  Independence between a and b )|()|( )|()|( cavitytoothachePcatchcavitytoothacheP cavitycatchPtoothachecavitycatchP =∧ =∧ )()|( )()|( bPabP aPbaP = =
  • 34. • The decomposition of large probabilistic domains into weakly connected subsets via conditional independence is one of the most important developments in the recent history of AI • This can work well, even the assumption is not true! ),,()( ),,,( )()()( cavitycatchtoothachePcloudyWeatherP cloudyWeathercavitycatchtoothacheP bPaPbaP == == =∧
  • 35. A single cause directly influence a number of effects, all of which are conditionally independent )|()(),...,,( 1 21 causeeffectPcausePeffecteffecteffectcauseP n i in ∏= =
  • 36. Naive Bayes Classifier  Along with decision trees, neural networks, nearest nbr, one of the most practical learning methods  When to use:  Moderate or large training set available  Attributes that describe instances are conditionally independent given classification  Successful applications:  Diagnosis  Classifying text documents
  • 37. Naive Bayes Classifier  Assume target function f: X  V, where each instance x described by attributes a1, a2 .. an  Most probable value of f(x) is:
  • 38. vNB  Naive Bayes assumption:  which gives
  • 39. Naive Bayes Algorithm  For each target value vj   estimate P(vj)  For each attribute value ai of each attribute a   estimate P(ai|vj)
  • 40. Training dataset age income student credit_rating buys_computer <=30 high no fair no <=30 high no excellent no 30…40 high no fair yes >40 medium no fair yes >40 low yes fair yes >40 low yes excellent no 31…40 low yes excellent yes <=30 medium no fair no <=30 low yes fair yes >40 medium yes fair yes <=30 medium yes excellent yes 31…40 medium no excellent yes 31…40 high yes fair yes >40 medium no excellent no Class: C1:buys_computer=‘yes’ C2:buys_computer=‘no’ Data sample: X = (age<=30, Income=medium, Student=yes Credit_rating=Fair)
  • 41. Naï ve Bayesian Classifier: Example  Compute P(X|Ci) for each class P(age=“<30” | buys_computer=“yes”) = 2/9=0.222 P(age=“<30” | buys_computer=“no”) = 3/5 =0.6 P(income=“medium” | buys_computer=“yes”)= 4/9 =0.444 P(income=“medium” | buys_computer=“no”) = 2/5 = 0.4 P(student=“yes” | buys_computer=“yes)= 6/9 =0.667 P(student=“yes” | buys_computer=“no”)= 1/5=0.2 P(credit_rating=“fair” | buys_computer=“yes”)=6/9=0.667 P(credit_rating=“fair” | buys_computer=“no”)=2/5=0.4  X=(age<=30 ,income =medium, student=yes,credit_rating=fair) P(X|Ci) : P(X|buys_computer=“yes”)= 0.222 x 0.444 x 0.667 x 0.0.667 =0.044 P(X|buys_computer=“no”)= 0.6 x 0.4 x 0.2 x 0.4 =0.019 P(X|Ci)*P(Ci ) : P(X|buys_computer=“yes”) * P(buys_computer=“yes”)=0.028 P(X|buys_computer=“no”) * P(buys_computer=“no”)=0.007 P(buys_computer=„yes“)=9/14 P(buys_computer=„no“)=5/14
  • 42.  Conditional independence assumption is often violated  ...but it works surprisingly well anyway
  • 43. Estimating Probabilities  We have estimated probabilities by the fraction of times the event is observed to nc occur over the total number of opportunities n  It provides poor estimates when nc is very small  If none of the training instances with target value vj have attribute value ai?  nc is 0
  • 44.  When nc is very small:  n is number of training examples for which v=vj  nc number of examples for which v=vj and a=ai  p is prior estimate  m is weight given to prior (i.e. number of ``virtual'' examples)
  • 45. Naï ve Bayesian Classifier: Comments  Advantages :  Easy to implement  Good results obtained in most of the cases  Disadvantages  Assumption: class conditional independence , therefore loss of accuracy  Practically, dependencies exist among variables  E.g., hospitals: patients: Profile: age, family history etc Symptoms: fever, cough etc., Disease: lung cancer, diabetes etc  Dependencies among these cannot be modeled by Naï ve Bayesian Classifier  How to deal with these dependencies?  Bayesian Belief Networks
  • 46.  Uncertainty & Probability  Baye's rule  Choosing Hypotheses- Maximum a posteriori  Maximum Likelihood - Baye's concept learning  Maximum Likelihood of real valued function  Bayes optimal Classifier  Joint distributions  Naive Bayes Classifier
  • 47. Bayesian Belief Networks Burglary P(B) 0.001 Earthquake P(E) 0.002 Alarm Burg. Earth. P(A) t t .95 t f .94 f t .29 f f .001 JohnCalls MaryCalls A P(J) t .90 f .05 A P(M) t .7 f .01