Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 14

Bayesian network

• A Bayesian network – also called a belief network or


causal probabilistic network- is a graphical
representation of probabilistic information: It is a
directed acyclic graph in which nodes represent
random (stochastic) variables, and links between nodes
represent direct probabilistic influences between the
variables.
Bayesian network Cont..
• Structured, graphical representation of probabilistic relationships
between several random variables
• Explicit representation of conditional independencies
• Missing arcs encode conditional independence
• Efficient representation of joint P(X)
• Generative model (not just discriminative): allows
• arbitrary queries to be answered, e.g.
Eg: P (lung cancer=yes | smoking=no, positive X-ray=yes ) = ?
Heart disease example

Once the right topology has been found. the probability table associated
with each node is determined.
Estimating such probabilities is fairly straightforward and is
similar to the approach used by naïve Bayes classifiers.
High Blood Pressure
• Suppose we get to know that the new patient has high blood
pressure.
• What’s the probability he has heart disease under this condition?
P(hd | bp)   e d h cp P(hd , e, d , h, cp, bp)
  e d h cp P(hd | e, d ) P(h | d ) P(cp | hd , h) P(bp | hd ) P(e) P(d )
 P(bp | hd )e P(e)d P(hd | e, d ) P(d )h P(h | d )cp P(cp | hd , h)
 P(bp | hd )e P(e)d P(hd | e, d ) P(d )
 P(bp | hd ) P(e)P(hd | e, d ) P(d )  P(hd | e, d ) P(d ) 
 P(bp | hd ) P(e)P(hd | e, d ) P(d )  P(hd | e, d ) P(d ) 
  * 0.85 * 0.7 * 0.25 * 0.25  0.45 * 0.75
  * 0.85 * 0.3 * (0.55 * 0.25  0.75 * 0.75)
  * 0.4165
High Blood Pressure (Cont’d)
P(hd | bp)   e d h cp P(hd , e, d , h, cp, bp)

  e d h cp P(hd | e, d ) P(h | d ) P(cp | hd , h) P(bp | hd ) P(e) P(d )

 P(bp | hd )e P(e)d P(hd | e, d ) P(d )h P(h | d )cp P(cp | hd , h)

 P(bp | hd )e P(e)d P(hd | e, d ) P(d )

 P(bp | hd ) P(e)P(hd | e, d ) P(d )  P(hd | e, d ) P(d ) 


 P(bp | hd ) P(e)P(hd | e, d ) P(d )  P(hd | e, d ) P(d ) 

  * 0.2 * 0.7 * 0.75 * 0.25  0.55 * 0.75


  * 0.2 * 0.3 * 0.45 * 0.25  0.25 * 0.75
  * 0.102
High Blood Pressure ()
1 1
 
0.4165  0.1020 0.5185

P(hd | bp)   * 0.4165  0.8033

P(hd | bp)   * 0.102  0.1967


High Blood Pressure, Healthy Diet,
and Regular Exercise
P(hd | bp, d , e)   h cp P(hd , e, d , h, cp, bp)
  h cp P(hd | e, d ) P(h | d ) P(cp | hd , h) P(bp | hd ) P(e) P(d )
 P(bp | hd ) P(e) P(hd | e, d ) P(d )h P(h | d )cp P(cp | hd , h)
 P(bp | hd ) P(e) P(hd | e, d ) P(d )
  * 0.85 * 0.7 * 0.25 * 0.25   * 0.03719
High Blood Pressure, Healthy Diet,
and Regular Exercise (Cont’d)
P(hd | bp, d , e)   h cp P(hd , e, d , h, cp, bp)
  h cp P(hd | e, d ) P(h | d ) P(cp | hd , h) P(bp | hd ) P(e) P(d )
 P(bp | hd ) P(e) P(hd | e, d ) P(d )h P(h | d )cp P(cp | hd , h)
 P(bp | hd ) P(e) P(hd | e, d ) P(d )
  * 0.2 * 0.7 * 0.75 * 0.25   * 0.02625
High Blood Pressure, Healthy Diet,
and Regular Exercise (Cont’d)
1 1
 
0.03719  0.02625 0.06344

P(hd | bp, d , e)   * 0.03719  0.5862

P(hd | bp, d , e)   * 0.02625  0.4138

The model therefore suggests that eating healthily and exercising


regularly may reduce a person's risk of getting heart disease.
Right or Wrong Topology?
• In general, there is no right or wrong graph topology.
– Of course the calculated probabilities (from the data) will be
different for different graphs.
– Some graphs will induce better classifiers than some other.
– If you reverse the arrows in the previous figure, then you get a
pure causal graph,
• whose induced classifier might have estimated error (through cross-
validation) better or worse than the Naïve Bayes one (depending on
the data).

• If the topology is constructed manually, we (humans) tend to


prefer the causal direction.
– In domains such as medicine the graphs are usually less complex
in the causal direction.

You might also like