In this exercise, we will learn the parameters of a Bayesian network from data stored in a Microsoft Sql Server Express database.

Prerequisites

1 - Bayes Server

Bayes Server must be installed, before starting this walkthrough.

Note

An evaluation version can be downloaded from the Bayes Server website.

2 - The Bayesian network 'Identification Extended'

This network is available, from either:

  1. The SampleNetworks folder, that is packaged with the course help

  2. By working through Exercise - construction.

3 - Sql Server Express Database

A Sql Server express database (2008 or later) must be installed, before starting this walkthrough.

Note

The database must be setup (once) using the database script that accompanies the course notes.

4 - Data Connection

A data connection to the BSTRX database must have been created. See Exercise - Data Connection.

Open the Bayesian network

  • Launch Bayes Server and open the Bayesian network IdentificationExtended.bayes located in the SampleNetworks folder, that is packaged with the course help.

    Note

    Alternatively the Bayesian network can be constructed manually in Exercise - construction.

Parameter learning

  1. Click the Parameter learning button on the Data tab on the main ribbon toolbar.

    This will launch the Data Selection window.

  2. Select the data connection named localhost\sqlexpress (BSTRX) set up in Exercise - Data Connection in the Data Connection drop down.

    Then set the table in the Data drop down to IdentificationExtended.

    Click Ok. This will launch the Data Map window.

  3. In the Data Map window, if the Weight drop down has been automatically mapped to the Weight column, set it to map to nothing.

    Caution

    It is important to clear the weight mapping, as the Weight drop down is used to assign a case weight, which is unrelated to the weight variable in our network.

    Exercise Parameter Learning Data Map
  4. Click Ok in the Data Map window, which will launch the Parameter learning window.

    Click the Start button. When learning has completed, dismiss the message box. The Parameter learning window should look something like the image below:

    Tip

    Because the data used for learning includes missing data, your results may differ slightly.

    Exercise Parameter Learning
  5. Click the Apply button, on the parameter learning ribbon toolbar. This will launch the Candidate networks window.

  6. Click the Ok button on the Candidate networks window, which will set the new distributions on the network.

  7. Select a node, and then click the Distribution button on the Network tab on the main ribbon toolbar.

    Inspect the new distribution that has been learnt.