Assignment 3

Bayesian Networks

Max possible score:

Task Description

Consider the following Bayesian Network

BayesianNetwork from Quiz4 Prep material
Image 1: A Bayesian Network

The Variables used here are as followes
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>
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

Query: <query variable values> [given <evidence variable values>]
Sample Queries:
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.
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: