5.Data Mining - Bayesian Network
5.Data Mining - Bayesian Network
Joint probability that the values of V1, V2,…., Vk are v1, v2,…,
vk, respectively can be represented by the expression
p(V1= v1, V2= v2, …, Vk= vk).
9/2/2024
2
Let’s consider 4 binary valued variables, B, M, L & G,
there are 16 joint probabilities over these variables,
each of the form p(B=b, M=m, L=l, G=g)
B M L G Joint
Prob.
T T T T 0.5686
T T T F 0.0299
T T F T 0.0135
T T F F 0.0007
…. …. …. …. ….
9/2/2024
3
When we know the values of all of the joint prob. for a set
of random variables, then we can compute what is called
the marginal prob. of one of these random var.
Where p(Vi , Vj) is the joint prob. of Vi & Vj, and p(Vj) is the marginal
prob. Of Vj.
9/2/2024
5
Joint prob. can be expressed in terms of a chain of conditional prob as
follows:
k
p (V1 , V2 ,...,Vk ) p (Vi | Vi 1 ,.....,V1 )
i 1
p(Vi , Vj) = p(Vi| Vj) p(Vj) = p(Vj| Vi) p(Vi) = p(Vj , Vi)
p(V j | Vi ) p(Vi )
Then, p(Vi | V j )
p(V j )
p(P, Q, R) = 0.3, p(P, Q, ¬R) = 0.2, p(P, ¬Q, R) = 0.2, p(P, ¬Q, ¬R)
= 0.1, p(¬P, Q, R) = 0.05, p(¬P, Q, ¬R) = 0.1, p(¬P, ¬Q, R) = 0.05,
p(¬P, ¬Q, ¬R) = 0.0
9/2/2024
7
Consider the following joint probabilities:
p(P, Q, R) = 0.3, p(P, Q, ¬R) = 0.2, p(P, ¬Q, R) = 0.2, p(P, ¬Q, ¬R)
= 0.1, p(¬P, Q, R) = 0.05, p(¬P, Q, ¬R) = 0.1, p(¬P, ¬Q, R) = 0.05,
p(¬P, ¬Q, ¬R) = 0.0
9/2/2024
8
A variable V is conditionally independent of a set of variables Vi,
given a set Vj, if p(V | Vi ,V j ) p(V | V j )
9/2/2024
10
Let’s assume that V1, V2, …, Vk be the nodes in a Bayes network
L p(L) = 0.7
B p(B) = 0.95
p(M|B, L) = 0.9
p(M|B, ¬L) = 0.05
G M p(M| ¬B, L) = 0.0
p(M| ¬B, ¬L) =
0.0
P(G|B) = 0.95
P(G| ¬B) = 0.1
p( G, B, M, L) = p(G|B)p(M|B, L)p(B)p(L)
9/2/2024
11
Considering the Bayes network of last slide, calculate
p(M|L)
9/2/2024
12
Considering the Bayes network of last slide, calculate
p(M|L)
9/2/2024
13
R Q p(Q) = 0.05
p(R) = 0.01 R
p(P|R, Q) = 0.95
P S p(S|Q) = 0.95
p(P|R, ¬Q) = 0.90
p(P| ¬R, Q) = 0.80 p(S| ¬Q) = 0.05
p(P| ¬R, ¬Q) = 0.01
U V
P(U|P) = 0.7 P(V|S) = 0.99
P(U| ¬P) = 0.2 P(V| ¬S) = 0.1
Calculate p(Q|U).
9/2/2024
14
From Bayes rule we have p(Q|U) = kp(U|Q)p(Q), where k=1/p(U)
Now, p(U | Q) p(U | P) p( P | Q)
p
So p(P | Q) 0.20
p(U|Q)=p(U|P)p(P|Q)+p(U|¬P)p(¬P|Q)=0.60
p(Q|U)=k*0.60*0.05=k*0.03------------------(1)
9/2/2024
16
9/2/2024
17
A generic entry in the joint probability
distribution P(X1, …, Xn) is given by:
n
P ( X 1 , X 2 ,..., X n ) P ( X i | Parents( X i ))
i 1
9/2/2024
18
Probabilityof the event that the alarm has
sounded but neither a burglary nor an
earthquake has occurred, and both Mary
and John calls:
9/2/2024
19
Probabilityof the event that the alarm has
sounded but neither a burglary nor an
earthquake has occurred, and both Mary and
John calls:
P(J∧ M ∧ A ∧ ¬B ∧ ¬E)
= P(J | A) P(M | A) P(A | ¬B ∧ ¬E) P(¬B) P(¬E)
=0.9 X 0.7 X 0.001 X 0.999 X 0.998
=0.00062
9/2/2024
20
Let A, B, C, D be Boolean random variables. Given that: A and
B are (absolutely) independent. C is independent of B given
A. D is independent of C given A and B.
Prob(A=T) = 0.3, Prob(B=T) = 0.6, Prob(C=T|A=T) = 0.8,
Prob(C=T|A=F) = 0.4, Prob(D=T|A=T,B=T) = 0.7,
Prob(D=T|A=T,B=F) = 0.8, Prob(D=T|A=F,B=T) = 0.1,
Prob(D=T|A=F,B=F) = 0.2
9/2/2024
23
(i) P (~B,C | A) = P (~B | A) P (C | A) = (0.15)(0.75) = 0.1125
(ii)
9/2/2024
24
An admission committee for a college is trying to determine the probability
that an admitted candidate is really qualified.
The relevant probabilities are given in the following Bayesian network.
Calculate p (A|D).
9/2/2024
25