Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 4 : Custom Model, By Hand ( 1 5 pts ) Your fourth task is to create and work through a model by hand.Step

Question 4: Custom Model, By Hand (15 pts)Your fourth task is to create and work through a model by hand.Step 1: Create your own Bayesian Network (BN)Draw out the graph for a Bayesian Network, digital or on paper is fineThe network should have atleast 8 variablesYou can name them most anything you like, but I recommend keeping it simpleOne variable must have atleast 3 parentsAtleast 4 variables (including above) must have 2 or more parentsSave or scan/photograph your graph (please stick to pdf, png or jpeg formats). Name the file student_bn.png, student_bn.jpg or student_bn.pdf.Highly recommended to read all the steps before starting here, so you don't end up with a network that can't satisfy later requirements. In particular, play close attention to the requirements for query, hidden and evidence/visible variables.Step 2: Finish your own Bayesian NetworkRemember, a BN is not complete until conditional distributions are specified for all variables. In this case, that means we need conditional probability tables for each variable.We will combine this step with creating the model file needed for your code to analyze your BN.The model file format is very simple, it is a csv (comma separated value) file containing sub-tables for each variableIt's possible to create these using a simple text editor, but you may find it easier to use Excel (or another spreadsheet program) or an online CSV editorSub-tables are separated by blank linesLines starting with # are treated as comments and ignored (theyare not treated as blank lines)The first row specifies the conditions and variableConditions are listed first (left)The variable for the table is last (right-most)The remaining rows are probabilities. Make one row for every possible combination of condition values, and in the right-most column list the probability for that row.Please name the file student_bn.csvRun the following command to check your model (load it in and print it back out): python3 prob_inf.py --model student_bn.csv --mode printFeel free to open up burglary_alarm.csv as an example how to construct the file.You may assign most any probabilities you like with one restriction: Every probability must be unique.For example, if you assign 0.99 in one place then you may not use 0.99 anywhere elsebut also you may not use 0.01(1-0.99) anywhere else. (And thus you may not use 0.5 anywhere.)(The point of the above is that both you and we can see exactly where a probability came from just by seeing the number.)Step 3: QueryNow make a probabilistic query for your BN.Decide on a query variable and value.Your query variable must have atleast one parentand atleast one child.Choose 3 hidden variables.Each hidden variable must be:1) Either a parent or child of the query variable2) Or, a parent or child of another hidden variablebut also a grandparent or grandchild of the query variableIn other words, every hidden variable must have a directed path either to the query variable or from the query variable, and only other hidden variables may be on that path.You may choose more than 3 hidden variables, but it's not recommended, as it will cause you significantly more work.Which means the remaining variables are evidence/visible variables. Choose values for them.Atleast one evidence variable must be a child of the query variable.Run your code from above (either Q2 or Q3 is fine) to get a result for this query.(The point of the above restrictions is to try to ensure you end up with a non-trivial problem to solve, that shows/lets you practice all the components of probabilistic inference. If you still end up with something you feel is too simple,please let me know so I can refine these instructions for future semesters.)Step 4: Inference by handNow calculate the same query by handTry to stick to the format shown on Slides 10-30 as much as possible.If (when) you have to spread the calculation across pages, please be as clear as possible which parts of the tree link up where.Save your work in either student_bn_inference.pdf, or if you are scanning/photographing paper work student_bn_inference_01.png, student_bn_inference_02.png, etc (or jpeg format is fine as well)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions