In this exercise, we will learn the parameters of a Mixture Model represented as 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 'Mixture Model 3D'

This network is available in the SampleNetworks folder, that is packaged with the course help.

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 MixtureModel3D.bayes located in the SampleNetworks folder, that is packaged with the course help.

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 MixtureModel3D.

    Click Ok. This will launch the Data Map window.

  3. Clear the mapping for the Cluster variable, leaving the default settings for the other variables.

    Tip

    To clear a mapping for a variable click the Eraser button next to the variable.

    Exercise Clustering Data Map No Cluster
  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 Clustering 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.

Charting the joint distribution

  1. Click the Custom button on the Query tab on the main ribbon toolbar.

  2. Select all the variables and click Add. The Custom query window should look like this:

    Exercise Clustering Custom Query
  3. Click the Query button. This will launch the Query Distribution window shown below.

    Note

    Because the learning process is random, your results might not be exactly the same.

    Exercise Clustering Joint Query
  4. Click the Plot button in the Query distribution window.

  5. When asked whether or not you wish to add data to the plot, click Yes. This will launch the Data Selection window.

  6. Ensure that localhost\sqlexpress (BSTRX) is selected in the Data Connection drop down.

    Ensure that MixtureModel3D is selected in the Data drop down.

    Click Ok. This will launch the Data Map window.

  7. Keep the default mappings but on the Information tab, check the box next to the Cluster column.

    The information tab should look like this.

    Exercise Clustering Data Map Information
  8. Click Ok on the Data Map window. This will launch the Data Plot options window.

  9. Select Cluster in the Color points based on drop down. The window should look like this:

    Exercise Clustering Data Plot Options
  10. Click Ok. This will launch the Charting window, which should look similar to the image shown below.

    Exercise Clustering Charting