For Homework six, you will need to implement a programming assignment to do
with Bayesian networks. This is the Bayesian network that we'll be
evaluating. This is a simple diagnostic network where
the variable are characteristics about the patient such as whether they smoke or not,
Whether they have visited Asia or not. Some symptoms such as whether or not they
have dyspnea, or whether or not they have tested positive for an X-ray, which shows
occlusion in the lung area, and there are three possible conditions that they may
have, which is tuberculosis, lung cancer, or bronchitis.
And our goal will be to write a program that will evaluate the a posteriori
probability of each of the three possible diseases given some combination of
evidence. For example, you maybe given that the
patient has visited Asia and has a positive X-ray, and then you need to
figure out which disease is most likely. The probabilities associated with this
network are given as follows. They're also available in this paper,
where this example was originally published.
Let me explain what these things mean. Alpha is the variable about Asia which has
the probability that somebody has actually visited Asia is 0.01. As a consequence,
the probability of not visiting Asia that is the probability of not A is 0.99. So,
those probabilities are implied in this description.
So, this is not the, all the possible values that you will need to encode.
Please note that. Similarly, the probability of tuberculosis given that
somebody's visited Asia, is five%.. Whereas, in general, if they have not
visited Asia, it's one%.. As a consequence of this, the probability
that somebody does not have tuberculosis if they have visited Asia is 95%.
And the probability that they do not have tuberculosis if they have not visited Asia
is 99%.. So, the converse probabilities need to be
inferred for each possible case in this description.
Don't forget that in your encoding. Once you've encoded this, you will be
given, evidence and asked questions about the a posteriori or rather the most likely
explanation that is the best diagnosis given the evidence.
For example, given no evidence whatsoever, what is the chance that you would have
tuberculosis? And the answer is just over one%, if you
believe this belief network. Your program can encode these
probabilities in tables and use SQL, the way of we described in class, to evaluate
the required a posteriori probability for each condition.
Using SQL makes it easier. And this network is certainly not too big
for any SQL engine to handle. Sql Lite3 in Python, which is built in, is
a good thing to use, or you can use any SQL engine, or you can encode the network
directly using any algorithm that you may wish to read up, but the one which we have
covered in class is SQL. So, this is the assignment.
Please implement your program, try it out for different possible conditions, and
then open Homework six to try and answer it.
It will be a timed homework, as before, so that I am sure you're actually using your
program. But there will be enough time to run your
program, type in the conditions that are given, and get the answer and answer the,
the homework. Good luck.