A Bayesian Network (also called a Belief Network or Bayes Net) is a probabilistic graphical model that represents a set of variables and their conditional dependencies using a directed acyclic graph (DAG).
Structure of a Bayesian Network
code
Cloudy
/ \
↓ ↓
Sprinkler Rain
\ /
↓ ↓
Wet Grass
In this classic example:
Nodes represent random variables (Cloudy, Sprinkler, Rain, Wet Grass)
Directed edges represent conditional dependencies
Each node has an associated conditional probability table (CPT)
Key Components
1. Nodes (Variables): Each node represents a random variable that can be discrete or continuous.
2. Directed Edges: Arrows indicate direct probabilistic influence from parent to child nodes.
3. Conditional Probability Tables: Each node X has a CPT that specifies P(X|Parents(X)).
For the example above:
P(Cloudy) - prior probability
P(Sprinkler|Cloudy) - probability of sprinkler given cloudy conditions
P(Rain|Cloudy) - probability of rain given cloudy conditions
P(WetGrass|Sprinkler, Rain) - probability of wet grass given sprinkler and rain states
Mathematical Foundation
The joint probability distribution for all variables in a Bayesian Network is:
P(X₁, X₂, ..., Xₙ) = ∏ᵢ P(Xᵢ|Parents(Xᵢ))
This factorization allows efficient computation and storage compared to representing the full joint distribution.
Bayesian Learning
Bayesian learning is a statistical approach to machine learning that applies Bayes' theorem to update beliefs about model parameters or hypotheses as new data becomes available.
Core Principle
Bayes' Theorem: P(H|D) = P(D|H) × P(H) / P(D)
Where:
P(H|D) is the posterior probability of hypothesis H given data D
P(D|H) is the likelihood of observing data D given hypothesis H
P(H) is the prior probability of hypothesis H
P(D) is the marginal likelihood (evidence)
Bayesian Learning Process
1. Prior Distribution: Start with initial beliefs about parameters θ, expressed as P(θ).
2. Likelihood Function: Define how likely the observed data is under different parameter values, P(D|θ).
3. Posterior Distribution: Update beliefs after observing data using Bayes' rule:
P(θ|D) ∝ P(D|θ) × P(θ)
4. Prediction: Make predictions for new data by integrating over the posterior:
P(x_new|D) = ∫ P(x_new|θ) × P(θ|D) dθ
The posterior distribution represents our updated belief about the coin's bias after seeing the data.
Advantages of Bayesian Learning
Uncertainty Quantification: Provides full probability distributions over parameters, not just point estimates
Prior Knowledge Integration: Can incorporate domain expertise through priors
Sequential Learning: Naturally handles online learning as posterior becomes prior for new data
Principled Decision Making: Enables optimal decisions under uncertainty
Common Applications
Parameter Estimation: Learning model parameters with uncertainty bounds
Model Selection: Comparing different models using marginal likelihoods
Prediction with Uncertainty: Generating predictions with confidence intervals
Active Learning: Selecting informative data points based on uncertainty
The Bayesian approach provides a coherent framework for learning from data while maintaining and updating uncertainty estimates throughout the process.