B : True if there is a Baseball Game on TV, False if not
G: True if George watches TV, False if not
C: True if George is out of Cat Food, False if not
F: True if George feeds his cat, False if not.
Let us say you are given some Training Data which represents what
happens over a period of time (For example: This file contains what
happens every evening over one specific year). Your Task is to learn
the conditonal probabilty tables for the bayesian network from the
training data. The training data will be formatted as follows:
Your program should be called bnet and the command line
invocation should follow the following format:
bnet.py
<training_data>
<training_data> text file with training data.
Once you are done calculating the conditional probabilites, the program should calculate
the probabilty for any event given evidence (if available) using
inference by enumeration.
Your program should display a prompt 'Query:' where you can enter the query in the following format
Values of Query Variables using the following format
Bt if B is true, Bf if B is false
Gt if G is true, Gf if G is false
Ct if C is true, Cf if C is false
Ft if F is true, Ff if F is false
Values of Evidence Variable (if any) [Format is same as for Query Variable]
Sample Queries:
Query: Bt Gf given Ff will use the Bayesian Network to calculate P(B=t, G=f | F=f)
Query: Bt Ff will use the Bayesian Network to calculate P(B=t, F=f)
You can display the calculated probabilty values in standard output.
After displaying the calculated probabilty, request another Query by displaying the prompt.
Repeat till Query is given as None.
Query: None will exit the program
Note: You may want to write a function in your code that uses the
semantic forumla for bayesian network to reconstruct the JPD values
from the Bayesian Network values that you have calculated. You can use
this function to obtain the JPD values when performing Inference by
enumeration.
How to submit
Implementations in C, C++, Java, and Python will
be accepted. Points will be taken off
for failure to comply
with this requirement unless previously cleared with the Instructor.
Create a ZIPPED
directory called <net-id>_assmt3.zip (no other
forms
of compression
accepted, contact the instructor or TA if you do not know how to
produce .zip files).
The directory should contain the source code for the task (no need for
any compiled binaries). Each
folder should also contain a file called readme.txt, which
should specify precisely:
Name and UTA ID of the student.
What programming language is used for this task. (Make sure to
also give version and subversion numbers)
How the code is structured.
How to run the code, including very specific compilation
instructions,
if compilation is needed. Instructions such as "compile using g++" are
NOT considered specific if the TA needs to do additional steps to get
your code to run.
If your code will run on the ACS Omega (not required) make a
note of it in the readme file.
Insufficient or unclear instructions will be penalized.
Code that
the TA cannot run gets AT MOST 75% credit (depending on if the student
is able to get it to run during a Demo session).