0% found this document useful (0 votes)
8 views19 pages

Lecture W13a

The document outlines a lecture on Bayesian Networks as part of the CS-871 Machine Learning course for Fall 2024. It covers key topics including Naïve Bayes Classifier, Gaussian Naïve Bayes Classifier, and the structure and application of Bayesian Networks in probabilistic graphical models. The lecture includes examples and in-class activities to enhance understanding of these concepts.

Uploaded by

Hadia Ramzan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views19 pages

Lecture W13a

The document outlines a lecture on Bayesian Networks as part of the CS-871 Machine Learning course for Fall 2024. It covers key topics including Naïve Bayes Classifier, Gaussian Naïve Bayes Classifier, and the structure and application of Bayesian Networks in probabilistic graphical models. The lecture includes examples and in-class activities to enhance understanding of these concepts.

Uploaded by

Hadia Ramzan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

CS-871: Machine Learning

Fall 2024 - Week 13


Bayesian Networks

Dr. M. Daud Abdullah Asif


Assistant Professor
Faculty of Computing, SEECS
Email: [email protected]
Lecture Outline

• Recap of previous lecture

• Naïve Bayes Classifier

• Gaussian Naïve Bayes Classifier

• Bayesian Networks
Recap of Probability Distributions

3
Recap - Bayes Theorem

𝑃 𝐵 𝐴 .𝑃(𝐴)
•𝑃 𝐴 𝐵 =
𝑃(𝐵)

• where
• 𝑃 𝐴 𝐵 is Posterior
• 𝑃 𝐵 𝐴 is likelihood
• 𝑃(𝐴) is Prior
• B is event of interest
• A is evidence

4
Bayes Theorem
• Bayes Theorem

5
Recap - Naïve Bayes Classifier
• Applications:
• Disease Diagnosis
• Document Classification
• Credit Scoring
• Sentiment Analysis
• Recommender Systems
• Spam Filtering

6
Recap - Laplace Smoothing
• Used when zero frequency problem occurs
• Add a Laplace Smoothing Factor Alpha to each event
• Default value of Alpha is 1.

7
Gaussian Naïve Bayes Classifier
• Used when features are continuous

• Assumes independence among features

• Assumes features have a Gaussian Distribution

1 1 𝑥−𝜇 2
− ( )
𝑓 𝑥 = 𝑒 2 𝜎
𝜎 2𝜋

8
Gaussian Naïve Bayes Classifier
• Example – Gender Classification
• Classify a new person whose height is 6ft, weight is 130 lbs,
and foot size is 8 inch.

10
Gaussian Naïve Bayes Classifier – Example

11
Gaussian Naïve Bayes Classifier – Example

1 𝑥−𝜇 2
1 − ( )
•𝑓 𝑥 = 𝑒 2 𝜎
𝜎 2𝜋

12
Gaussian Naïve Bayes Classifier – Example
1 𝑥−𝜇 2
1 − ( )
•𝑓 𝑥 = 𝑒 2 𝜎
𝜎 2𝜋
• Based on your calculations, what is the gender of the new test
sample?

• Male / Female?

13
Bayesian Networks
A Bayesian network (BN) is a probabilistic graphical model for representing knowledge about an
uncertain domain, where each node corresponds to a random variable and each edge represents
the conditional probability for the corresponding random variables.

14
Bayesian Networks
• Identify all the variables

• Draw arrows showing dependencies by using prior knowledge

• Define a local conditional distribution for each variable

• Multiply the local conditional distribution to form the joint


distribution

15
Bayesian Networks

• Alarm Example
• Earthquakes and burglaries are independent events.
• Either cause an alarm to go off.
• Suppose you get an alarm.
• Does hearing that there's an earthquake increase, decrease, or
keep constant the probability of a burglary?

16
In-class Activity
• Make a group of 4 students

• Find a use case of a Bayesian Network with DAG for better


understanding

• 10 mins

17
Bayesian Networks
• Example
• Medical Diagnosis

• A patient is coughing and have itchy eyes, do the patient have allergies or
cold?
• Make a DAG (variables, edges) and equate joint and local conditional
distributions…

18
Bayesian Networks – Solved example
• Example
• Medical Diagnosis

19
Questions?

You might also like