Sie sind auf Seite 1von 7

Lesson Bayesian Networks

In this Lesson
• Verbose reasoning using specialized software.

4 Duration : approximately 30-60 minutes

Verbose reasoning using specialized software.


In this lesson we will use again the Sinus problem to cover the Verbose query mode in Belief an
Decision Network tool from AIspace.

1. To start, load the file BN_Excersise_2.xml, so the main window of the application will show like
the one in Picture 1.

Picture 1

2. You will have to set the application in Verbose query mode. To do that, click on Network
Options menu, click submenu Query Modes and then select Verbose Query Mode.
3. Open the Solve tab.
4. Select Query button from the Solve toolbar.
5. Click on node S, to verbose query the node.
A new dialog frame Queering Node S will open like the one shown in Picture 2. When you query
a node in verbose mode, the node you chose to query will now have a thick green border
around it, and lines will have appeared, joining the parents of any node that are not already

International Hellenic University 1


Paraskevopoulos Konstantinos
Bayesian Networks

joined. In our case node S that you chose to query will now have a thick green border around it,
and lines will appear, joining the parents Fl and A.

Picture 2

On the left hand side of the query window, you will see two lists of factors: current and
eliminated as you can see in Picture 3. Notice that the list of eliminated factors is blank.

Picture 3

6. In the Current Factors list, click on the item with the name f0(S, A, Fl).
Inspecting Factors dialog frame will open as you can see in Picture 4. As you may have noticed
already this dialog frame contains all the possible values of the probability P(S|A,Fl).

International Hellenic University 2


Paraskevopoulos Konstantinos
Bayesian Networks

Picture 4

7. Next to the label Inspecting Factor there will be a drop-down menu with the name of the factor
you chose to inspect selected i.e. f0(S, A, Fl). If you select another factor from that menu, the
window will change and you will see the values for the new factor. Select the item f2(S, Ti) which
represents the probability P(Ti, S), to open the frame dialog shown in Picture 5.

Picture 5

8. On the right hand side of the frame dialog shown in Picture 5 there is a series of buttons, directly
underneath the label Value. Click on any one of those buttons to open the Derivation dialog
frame which shows how the value was calculated. For example if you click on button with the

International Hellenic University 3


Paraskevopoulos Konstantinos
Bayesian Networks

value 0.8 the frame dialog in Picture 6 will be shown which says what that value exactly that
value represents.

Picture 6

9. Close the Derivation frame dialog by clicking OK.


10. Click OK again in the Inspecting factors frame dialog to return to the query frame dialog.
11. On the left side of the frame dialog Queering Node S, see the five stages that someone must
undertake to complete a query. Those five stages as you can see in Picture 7 are :
1. pruning irrelevant variables,
2. projecting observations,
3. eliminating variables,
4. multiplying final factors, and
5. normalizing final factors.

International Hellenic University 4


Paraskevopoulos Konstantinos
Bayesian Networks

The five stages in the process of completing a query.

Picture 7

These stages must be completed in order, although stages will be automatically skipped under
certain conditions (for example, if there are no observations step two will automatically be
skipped). Your current progress through the stages can be determined by the state of the
buttons under each stage description.
It is possible to advance through the stages either by using the buttons on the left panel, or by
directly interacting with the graph. You can interact with the graph by right clicking on the
canvas and selecting an action, or by left clicking on nodes. Left clicking on a node has different
behavior depending on the stage that you are in. For example, clicking on an observed node
while you are in the Project Observations stage will project the nodes observation. You can
rearrange the graph to make it easier to read by dragging nodes and using the auto scale option
by right clicking on the canvas and selecting Autoscale.
12. To improve the efficiency of your query, you can prune irrelevant variables from the graph.
Click on Yes button in the Prune Irrelevant Variables stage, variables Ti and H will be pruned and
treated as having been eliminated as they don’t affect the probability of the current query node
S. The irrelevant variables are chosen according to the definition of conditional independence.
An algorithm that implements the criteria for d-separation is used. The model after the
elimination of the two variables will be like the one shown in Picture 8.

International Hellenic University 5


Paraskevopoulos Konstantinos
Bayesian Networks

The model after the elimination of variables Ti and H.


Picture 8

During the Eliminate Variables stage, there are two ways in which you can choose variables to
eliminate.
13. Try the Auto-Eliminate button to eliminate all the variables in the order specified by the
heuristic which is specified by the drop down menu next to label Heuristic. The available
heuristics are Max-Cardinality, Min-Degree, Min-Factor, Min-Fill, Random, and Sequential. The
Eliminate Next button will eliminate a single variable each time you press it.
14. Press the Reset query button to reset your query.
15. Try the second way to choose variables to eliminate by clicking on them directly. When you
eliminate a variable, it will be grayed out, and the lists of current and eliminated factors will be
updated accordingly. You should see a new factor at the bottom of the Current Factors list, and
the variables in that new factor should all be joined if they weren't already. Once all the
variables have been eliminated, the only factor remaining will be the answer. A window will also
open up giving you the query results. This is the same window you would get if you were
querying the node in Brief Query Mode.
16. Practice by yourself. Having in front of you the results from Table 1 in lesson 3 try query the
nodes of your model in verbose query mode.

International Hellenic University 6


Paraskevopoulos Konstantinos
Bayesian Networks

International Hellenic University 7


Paraskevopoulos Konstantinos

Das könnte Ihnen auch gefallen