In these lab exercises, you work with Bayesian networks.
This exercise reviews the burglary example from the text (Figure 14.2).
Do the following exercises based on AIMA’s burglary example given in Figure 14.2.
Download the following sample code: lab1.py.
Verify that the code produces the correct answers for the following examples from the text and lecture:
Be sure that you can explain these answers (i.e., by reviewing your class notes or the text, Section 14.4.1).
The following exercises demonstrate conditional independence using Bayesian networks that have varied topologies. See Section 13.5.2 for a discussion of conditional independence. The first exercise concerns a two-test cancer example.1
| The Bayesian network shown on the right represents a cancer
domain in which two different cancer tests can be run and in which
the tests are considered to be conditionally independent of one
another.
Implement this network and use it to compute the following probabilities:
Do the results make sense? How much effect does one failed test have on the probability of having cancer? Be sure that you can explain your answers (i.e., by working them out by hand). |
![]() |
The second example concerns a two-cause happiness example.2 Here, the causes are conditionally independent as well, but their probabilities can influence one another during inference.
|
The Bayesian network shown on the right represents a happiness domain in which either the sun or a raise in pay can increase the happiness of an agent.
|
![]() |
The exact inference algorithms used above tend to be intractable in real problems, so approximation algorithms are necessary.
Rerun your the inferences specified in the previous exercises using rejection sampling (see Figure 14.14), likelihood estimate (see Figure 14.15), and Gibbs sampling (see Figure 14.16). Do the results match those of the exact inference algorithms? Why or why not?
Submit your source code as specified above in Moodle under lab 6.
1 This example is taken from Thrun’s two-test cancer
example.
2 This example is taken from Thrun’s
confounding clause example.