Bayesian Network in Machine Learning

In this article, we are going to understand the concept of Bayesian Network.

Well, a Bayesian Network falls under the category of Probabilistic Graphical Modelling that is used to compute uncertainties by using the concept of probability. The fundamental concept behind Bayesian Network is probability. We all know that the probability describes the occurrence of an event. A lot of mathematical models are based on the concept of probability. Bayesian networks are also known as belief network or casual network. They are used to model uncertainties by using a directed acyclic graph.

So, what is a directed acyclic graph? A directed acyclic graph is used to represent a Bayesian network and like any other statistical graph contains a set of nodes and links, where the links denote the relationship between the nodes. It models the uncertainty of an event occurring based on the conditional probability distribution of each random variable. An illustrative diagram of the Directed Acyclic Graph is shown below –

nodes-edges

In this diagram, A, B, C, and D represent nodes and the lines connecting different nodes are called edges. The nodes define the random variables and the edges define the relationship between variables. We can see that node C is dependent on node A and node B which means node A and B are parent nodes of node C. Similarly, node D is dependent on node C which makes the node D, the child node of node C. This graph will model uncertainties by using Conditional Probability Distribution.

 

Now, let’s understand the basic mathematical concept behind Bayesian Network. The two mathematical concepts that are used in the Bayesian network are –

  • Joint Probability Distribution

It is a measure of two events happening at the same time, i.e., P (A and B). The probability of A and B can be written as P(A⋂B).

  • Conditional Probability Distribution

It represents that event B will only occur given that event A has already been occurred. The probability of A and B can be represented as P(B|A).

 

We will take an example of Bayesian Network. Let us assume that we are creating a Bayesian network that will model the marks m of students on his examination. The marks will depend on a couple of factors which are –

a) Exam level (denoted by e) –

It is a discrete variable that can take two values i.e., difficult or easy. It is dependent on student’s marks.

b) IQ of the student (denoted by i) –

It is also a discrete variable that can take two values i.e., low or high. The marks of a student are also directly dependent on the IQ level.

c)Marks (denoted a) –

This variable describes whether or not a student can get admission in a university.

d)Aptitude IQ (denoted by s) –

This variable represents the IQ of the aptitude of a student. It is directly dependent on IQ.

 

The Bayesian Network can be represented as –

bayesian-network

In this Bayesian Network, we have drawn a directed acyclic graph and conditional probability tables that contain the conditional probability of each node. Now, we are going to factorize the joint probability distribution we get –

P(a,m.i,e,s) = P(a|m) P(m|i,e) P(i) P(e) P(s|i)

where,

  • P(a|m) represents the Conditional Probability of a student getting admission based on his marks.
  • P(m|i,e) represents the Conditional Probability of a student getting marks based on his IQ level and exam level.
  • P(i) represents the probability of IQ level.
  • P(e) represents the probability of the exam level.
  • P(s|i) represents the Conditional Probability of a student’s aptitude score based on his IQ level.

Now, we know that the probability of a random variable depends on its parent nodes. Therefore, we can formulate the Bayesian Network equation as:

equation

Bayesian Networks have innumerable applications in various fields. They are –

  • Bayesian networks are used in the detection and prevention of diseases. They are used to model possible symptoms and predict whether a person is suffering from that disease.
  • They are used in optimized web searches as they improve the search accuracy by understanding the intent of a search and providing the most relevant search results.
  • They are also used in spam filtering and gene regulatory network.