Professional Documents
Culture Documents
DOC-20240413-WA0031.
DOC-20240413-WA0031.
REASONING
UNIT II PROBABILISTIC REASONING
• Acting under uncertainty – Bayesian inference
– naïve bayes models. Probabilistic reasoning
– Bayesian networks – exact inference in BN –
approximate inference in BN – causal
networks.
• Uncertainty
• When we are not sure about the situation then
the situation is called Uncertainty.
• Example
• Final Sem examination results
• You are not sure about pass/fail till the results are
published
• Covid 19
• Best eg for uncertainty.
• We were unaware of the disease till Dec 2019.
Acting under uncertainty
What is the probability that the randomly selected candidate is female and
she passed in the exam?
General form of Bayes’ rule with
normalization is
Example
A doctor knows that the disease meningitis causes a patient to have a stiff neck,
say, 70% of the time. The doctor also knows some unconditional facts: the prior
probability that any patient has meningitis is 1/50,000, and the prior probability
that any patient has a stiff neck is 1%. What is the probability that a patient has
the disease meningitis with a stiff neck?
In a neighbourhood, 90% children were falling sick due flu and 10% due to measles
and no other disease. The probability of observing rashes for measles is 0.95 and
for flu is 0.08. If a child develops rashes, find the child’s probability of having flu.
Apply the Bayes' rule for the following
From a standard deck of playing cards, a single card is drawn. The probability that the card is
king is 4/52, then calculate posterior probability P(King|Face). Assume the drawn face card is
a king card.
naïve bayes models
Given the data for symptoms and whether patient have flu or not, classify
following:
x = (chills = Y, runny nose = N, headache = mild, fever = Y)
P(FLU)=YES P(FLU)=NO
5/8 3/8
RUNNY HEADACHE
NOSE
Flu = Flu = Flu = Yes Flu = No
Yes No
Strong 2/3 1/3
Yes 4/5 1/5
No 1/2 1/2
FEVER
No 2/4 2/4
Pros of Naïve Bayes
• It is easy and fast to predict a class of test data set
• Naïve Bayes classifier performs better compared
to other models i.e. logistic regression and it
needs less training data
• It performs well in case of categorical input
variables compared to numerical variables
• Highly scalable, it scales linearly with number of
predictors and data points
• Handles continuous and discrete data
• Not sensitive to irrelevant features
Bayesian network
• A Bayesian network is a graph:
• A set of random variables
• A set of directed links connects pairs of nodes
• Each node has a conditional P table that
quantifies the effects that the parents have on
the node
• The graph has no directed cycles (DAG
A Bayesian Network
A Bayesian network is made up of:
1. A Directed Acyclic Graph
A
C D
C D
P1 P2
ND ND
X
1 2
C1 C2
C D
B
These numbers are from the
conditional probability tables
C D
C D
C D