...

/

Understanding the Output of the Model

Understanding the Output of the Model

Understand the conceptual output of a Bayesian network.

Understanding the output of the Bayesian network on Python using CausalNex

We have seen that creating Bayesian networks in Python is quite simple, it takes just a few lines of code! However, the most important thing is to understand the output of these networks.

A query refers to a request for computing the probability of certain outcomes or states given some known conditions or evidence. Remember that a Bayesian network is a graphical model that represents a set of variables and their conditional dependencies via a directed acyclic graph (DAG). Queries in this context are used to infer the probabilities of unknown variables based on known variables.

The baseline query

Let's take the rain model BN model. In this example, “Wet Grass” is the target node.

Press + to interact
The baseline query for the rain model
The baseline query for the rain model

First let's explore what are the baseline probabilities that each of the nodes has:

Baseline query

Node Name

P(True)

P(False)

Cloudy

0.50

0.50

Rain

0.49

0.51

Sprinkler

0.72

0.28

Wet Grass

0.86

0.14

Our Bayesian network diagram would look like this

Press + to interact
The baseline query for the rain model
The baseline query for the rain model

This means there is a 51% probability that ...