Professional Documents
Culture Documents
Unit-3 (Bayesian Belief Networks)
Unit-3 (Bayesian Belief Networks)
BELIEF NETWORKS)
Dr. K. Aditya Shastry
Professor
Dept. of ISE
NMIT, Bengaluru
Topics in BAYESIAN BELIEF NETWORKS
(BBN)
• Model Representation
• Model Building
• Example of Inferencing using BBN
• Characteristics of BBN
Introduction
• The conditional independence assumption made by naive Bayes classifiers may
seem too rigid, especially for classification problems in which the attributes are
somewhat correlated.
• This section presents a more flexible approach for modeling the class-
conditional probabilities P(X|Y).
• Consider 3 random variables, A, B, and C, in which A and B are independent variables and each
has a direct influence on a third variable, C.
• The relationships among the variables can be summarized into the directed acyclic graph shown in Figure
Node Variable
Arc dependence relationship between the pair of variables
Directed arc from A to C indicates that A is parent of C & C is child of
A
Model Representation
• If there is a directed path in the network from X to Z, then X is an ancestor of Z, while Z is a
descendant of X.
• For example, in the diagram shown in Figure. A is a descendant of D and D is an ancestor of B.
Both B and D are also non-descendants of A.
• Besides the conditional independence conditions imposed by the network topology, each node is
also associated with a probability table.
If a node X does not have any parents, then the table contains only the prior probability P(X).
If a node X has only one parent, Y, then the table contains the conditional probability P(XIY).
If a node X has multiple parents, {Y1,Y2, . . . ,Yn}, then the table contains the conditional probability P(XlY 1,Y2,. . .,
Yk).
BBN: Problems
F C
P(C|F) =0.8
P(F)=0.1
P (C| ҄F) =0.3
Write down the joint probability table specified by the Bayesian Network
Ans: P(A,B) = P(A) * P(B|A)
F C Joint Probability
f t P(F=f, C=t) = P( ҄ F) * P(C| ҄F) = (1-P(F=t)) * 0.3 = (1-0.1) * 0.3= 0.9 * 0.3 = 0.27
f f P(F=f, C=f) = P( ҄ F) * P( ҄C| ҄F) = (1-P(F=t)) * (1 – P(C| ҄F)) = (1-0.1) * (1-0.3) = 0.63
BBN: Problems
2. Determine the probabilities for the following Bayesian network
P(F|C) =?
P(C)=? C F
P (F| ҄C) =?
So that it specifies the same joint probabilities as the given one
F C Joint Probability
t t 0.08
t f 0.02
f t 0.27
f f 0.63
Ans: P(A,B) = P(A) * P(B|A) P(B|A) = P(A,B) / P(A)
P(C) = P(F=t | C=t) + P(F=f |C=t)= 0.08 + 0.27 = 0.35
P(F|C) = P(F=t, C=t) / P(C) = 0.08 / 0.35 = 0.23
P(F| ҄C) = P(F=t, C=f) / P( ҄C) = 0.02 / (1-0.35) = 0.02 / 0.65 = 0.03
BBN: Problems
• Which one of the 2 Bayesian networks given below makes independent assumptions that are not
true? Explain all your reasoning. Alarm-1 means that the 1st alarm system rings, Alarm-2 means
that 2nd alarm system rings and burglary means that a burglary is in progress.
Ans:
2nd one falsely assumes that Alarm-1 & Alarm-2 are independent if value of Burglary is unknown
BBN: Problem
• Apply BBN to identify whether a person has heart disease P(HD=yes) or not P(HD=No) without any prior
information.
Ans:
P(HD=Yes)
P(HD=Yes | E=Yes, D=Healthy) *P(E=Yes)*P(D=Healthy)
+
P(HD=Yes | E=Yes, D=Unhealthy) * P(E=Yes)*P(D=Unhealthy)
+
P(HD=Yes | E=No, D=Healthy) * P(E=No) * P(D=Healthy)
+
P(HD=Yes| E=No, D=Unhealthy) * P(E=No) * P(D=Unhealthy)
= (0.25 * 0.7 * 0.25)
+
(0.45 * 0.7 * (1-0.25)
+
0.55 * (1-0.7)*0.25
+
0.75 * (1-0.7) * (1-0.25)
=
0.49
• Apply BBN to identify whether a person has heart disease P(HD=yes) or not P(HD=No) given that BP=High
Ans:
If person has high BP, then HD can be diagnosed using P(HD=Yes|
BP=High)
1st compute
P(BP=High) P(BP=High | HD=Yes) * P(HD=Yes)
+
P(BP=High | HD=No) * P(HD=No)
0.85 * 0.49 + 0.2 * 0.51 = 0.5185
(
P(HD=Yes | BP=High) = P(A|B) =
P(B|A)*P(A) / P(B)
= = 0.8033 )
Since 0.8033 > 0.1967, when person has high BP, it increases the risk
of heart disease.
BBN problem
• Apply BBN for the following network for P(C) and P( ҄C) with no prior information.
S B Ans:
0.3 0.6 P(C)P(C|S, B)*P(S)*P(B) + P(C|S, ҄B)*P(S)*P( ҄B) + P(C|
҄S,B)*P( ҄S)*P(B)+ P(C| ҄S , ҄B)*P( ҄S)*P( ҄B)
P(C) 0.476
• Apply BBN for the following network for P(C) and P( ҄C) given that ForestFire (F) =Yes.
Ans:
S B We need to calculate P(C|F) and P ( ҄ C | F)
0.3 0.6
1st compute
P(F) P(F| C) * P(C) + P(F| ҄ C) * P( ҄C)
0.3 * 0.476 + 0.7 * 0.524 =
L 0.1428 + 0.3668 = 0.5096
S 0.2
P(C| F) = = = 0.280 (P(A|B) = P(B|A)*P(A) /
҄ 0.8 P(B))
S
Similarly, P( ҃ C|F) = 1 – P(C | F)
= 1 – 0.280
= 0.72
҄ 0.6 ҄ 0.7
L C
Model Building in Bayesian Belief Networks (BBN)
• Model building in Bayesian networks involves two steps:
• (1) creating the structure of the network, and
• (2) estimating the probability values in the tables associated with each node.
• The network topology can be obtained by encoding the subjective knowledge of domain experts.
Algorithm presents a systematic procedure for inducing the topology of a Bayesian network.
Model Building in BBN
BBN Characteristics
Following are some of the general characteristics of the BBN method:
• BBN provides an approach for capturing the prior knowledge of a particular domain using a
graphical model. The network can also be used to encode causal dependencies among
variables.
• Constructing the network can be time consuming and requires a large amount of effort. However,
once the structure of the network has been determined, adding a new variable is quite
straightforward.
• Bayesian networks are well suited to dealing with incomplete data. Instances with missing
attributes can be handled by summing or integrating the probabilities over all possible values
of the attribute.
• Because the data is combined probabilistically with prior knowledge, the method is quite robust to
model overfitting.
THANK YOU