Skip to main content

Causal AI | Optimization tutorial

In this tutorial we demonstrate the process of evidence optimization where some of the inputs are interventions.

info

For more information on Causal Optimization and Causal AI in general, see the article Introduction to Causal AI.

Open the model

We will use the Causal Optimization Simple sample network installed with Bayes Server. This is a simple healthcare model, which models the probability of recovery depending on whether a patient is treated with DrugA and/or DrugB, or neither.

Treatment with DrugA and/or DrugB are interventions, so we need to perform Causal optimization in this case.

info

Note that if we were to perform a non-causal optimization, the recommendation would be NOT to treat the patient with either drug, which is incorrect.

  • Launch Bayes Server, and on the Start page click the network entitled 'Causal Optimization Simple' in the Sample networks pane.
info

If the Start page is not set to display on start up, or has been closed, click the Start page button, on the Application tab.

Causal Optimization Simple network

Launch the optimizer

  • Select the Causal toolbar tab, click Causal Optimizer and choose Maximize.
info

Note that we can maximize, minimize and goal seek the output of discrete and continuous variables, but also function nodes, which can be arbitrary expressions.

  • In the Variable Selector dialog, ensure both DrugA and DrugB are selected as shown below. These are the variables which are potential interventions.

Intervention Variable Selector

  • Click Ok.

Objective Definition

  • In the Objective Definition page, change the following:

    1. Target / Objective = Recovered
    2. Target (Objective) state = True

The page should look as follows:

Objective Definition

  • Click Next

Design Variables

  • Remove Comorbidity from ths selected design variables.

The page should look as follows:

Design Variables

  • Click Next.

Design Variable Configuration

  • Ensure both DrugA and DrugB have the value Do for the Intervention column.
info

Do is another term used to indicate that this is an intervention.

The page should look as follows:

Design Variable Configuration

  • Click Next.

Design State Configuration

  • Leave the default values.

The page should look as follows:

Design State Configuration

  • Click Next.

Optimization Algorithm

  • There is currently only one option, so click Next.

Inference Algorithm

  • Ensure the Relevance Tree algorithm is selected.
  • Click Next.
info

For this model, although Commorbidity is a confounding variable, it is not unobserved, so we can use the Relevance Tree algorithm. If Commorbidity was an Unobserved Confounder we would need to use a different algorithm.

Options

  • Leave the default options
  • Click Next.

Run

  • Click Run to start the optimization process.
  • When complete, the Optimization Candidates page will automatically be displayed.

Causal Optimizer in progress

In the run shown below, note the following:

  1. The Objective Value is 0.8765 (i.e. P(Recovered | Optimal evidence) = 87.65%)
  2. Both DrugA and DrugB have intervention (Do) evidence set to true.

Optimization Candidates

  • Click Finish.
info

Note that the evidence found by the optimizer is now set on the network, as shown below:

Network with causal evidence set