Bayesian Networks. Motivation The conditional independence assumption made by naïve Bayes classifiers may seem to rigid, especially for classification.

Slides:



Advertisements
Similar presentations
Bayesian networks Chapter 14 Section 1 – 2. Outline Syntax Semantics Exact computation.
Advertisements

Naïve Bayes. Bayesian Reasoning Bayesian reasoning provides a probabilistic approach to inference. It is based on the assumption that the quantities of.
BAYESIAN NETWORKS. Bayesian Network Motivation  We want a representation and reasoning system that is based on conditional independence  Compact yet.
1 Knowledge Engineering for Bayesian Networks. 2 Probability theory for representing uncertainty l Assigns a numerical degree of belief between 0 and.
Identifying Conditional Independencies in Bayes Nets Lecture 4.
For Monday Finish chapter 14 Homework: –Chapter 13, exercises 8, 15.
1 22c:145 Artificial Intelligence Bayesian Networks Reading: Ch 14. Russell & Norvig.
Bayesian Networks Chapter 14 Section 1, 2, 4. Bayesian networks A simple, graphical notation for conditional independence assertions and hence for compact.
Uncertain knowledge and reasoning
CPSC 322, Lecture 26Slide 1 Reasoning Under Uncertainty: Belief Networks Computer Science cpsc322, Lecture 27 (Textbook Chpt 6.3) March, 16, 2009.
Bayesian networks practice. Semantics e.g., P(j  m  a   b   e) = P(j | a) P(m | a) P(a |  b,  e) P(  b) P(  e) = … Suppose we have the variables.
Review: Bayesian learning and inference
Bayesian Networks Chapter 2 (Duda et al.) – Section 2.11
1 Data Mining with Bayesian Networks (I) Instructor: Qiang Yang Hong Kong University of Science and Technology Thanks: Dan Weld, Eibe.
Bayesian networks Chapter 14 Section 1 – 2.
CSCI 5582 Fall 2006 CSCI 5582 Artificial Intelligence Lecture 14 Jim Martin.
Bayesian Belief Networks
Bayesian Belief Network. The decomposition of large probabilistic domains into weakly connected subsets via conditional independence is one of the most.
1 Bayesian Reasoning Chapter 13 CMSC 471 Adapted from slides by Tim Finin and Marie desJardins.
University College Cork (Ireland) Department of Civil and Environmental Engineering Course: Engineering Artificial Intelligence Dr. Radu Marinescu Lecture.
Bayesian Networks What is the likelihood of X given evidence E? i.e. P(X|E) = ?
Bayesian networks practice. Semantics e.g., P(j  m  a   b   e) = P(j | a) P(m | a) P(a |  b,  e) P(  b) P(  e) = … Suppose we have the variables.
Bayesian Reasoning. Tax Data – Naive Bayes Classify: (_, No, Married, 95K, ?)
Bayesian networks More commonly called graphical models A way to depict conditional independence relationships between random variables A compact specification.
Probabilistic Reasoning
EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS
Bayesian Networks Material used 1 Random variables
Artificial Intelligence CS 165A Tuesday, November 27, 2007  Probabilistic Reasoning (Ch 14)
Bayesian networks Chapter 14. Outline Syntax Semantics.
Bayesian networks Chapter 14 Section 1 – 2. Bayesian networks A simple, graphical notation for conditional independence assertions and hence for compact.
An Introduction to Artificial Intelligence Chapter 13 & : Uncertainty & Bayesian Networks Ramin Halavati
CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes March 13, 2012.
Probabilistic Belief States and Bayesian Networks (Where we exploit the sparseness of direct interactions among components of a world) R&N: Chap. 14, Sect.
Bayesian networks. Motivation We saw that the full joint probability can be used to answer any question about the domain, but can become intractable as.
1 Chapter 14 Probabilistic Reasoning. 2 Outline Syntax of Bayesian networks Semantics of Bayesian networks Efficient representation of conditional distributions.
2 Syntax of Bayesian networks Semantics of Bayesian networks Efficient representation of conditional distributions Exact inference by enumeration Exact.
An Introduction to Artificial Intelligence Chapter 13 & : Uncertainty & Bayesian Networks Ramin Halavati
Suppose we choose the ordering M, J, A, B, E P(J | M) = P(J)? Example.
CS 416 Artificial Intelligence Lecture 14 Uncertainty Chapters 13 and 14 Lecture 14 Uncertainty Chapters 13 and 14.
Probabilistic Reasoning [Ch. 14] Bayes Networks – Part 1 ◦Syntax ◦Semantics ◦Parameterized distributions Inference – Part2 ◦Exact inference by enumeration.
Marginalization & Conditioning Marginalization (summing out): for any sets of variables Y and Z: Conditioning(variant of marginalization):
Bayesian Networks CSE 473. © D. Weld and D. Fox 2 Bayes Nets In general, joint distribution P over set of variables (X 1 x... x X n ) requires exponential.
Review: Bayesian inference  A general scenario:  Query variables: X  Evidence (observed) variables and their values: E = e  Unobserved variables: Y.
1 CMSC 671 Fall 2001 Class #20 – Thursday, November 8.
CPSC 7373: Artificial Intelligence Lecture 5: Probabilistic Inference Jiang Bian, Fall 2012 University of Arkansas at Little Rock.
CPSC 322, Lecture 26Slide 1 Reasoning Under Uncertainty: Belief Networks Computer Science cpsc322, Lecture 27 (Textbook Chpt 6.3) Nov, 13, 2013.
Bayesian networks Chapter 14 Slide Set 2. Constructing Bayesian networks 1. Choose an ordering of variables X 1, …,X n 2. For i = 1 to n –add X i to the.
Conditional Independence As with absolute independence, the equivalent forms of X and Y being conditionally independent given Z can also be used: P(X|Y,
PROBABILISTIC REASONING Heng Ji 04/05, 04/08, 2016.
Chapter 12. Probability Reasoning Fall 2013 Comp3710 Artificial Intelligence Computing Science Thompson Rivers University.
CS 2750: Machine Learning Bayesian Networks Prof. Adriana Kovashka University of Pittsburgh March 14, 2016.
Web-Mining Agents Data Mining Prof. Dr. Ralf Möller Universität zu Lübeck Institut für Informationssysteme Karsten Martiny (Übungen)
Bayesian Networks Chapter 2 (Duda et al.) – Section 2.11 CS479/679 Pattern Recognition Dr. George Bebis.
A Brief Introduction to Bayesian networks
Another look at Bayesian inference
Reasoning Under Uncertainty: Belief Networks
CS 2750: Machine Learning Directed Graphical Models
Bayesian Networks Chapter 14 Section 1, 2, 4.
Bayesian networks Chapter 14 Section 1 – 2.
Presented By S.Yamuna AP/CSE
Qian Liu CSE spring University of Pennsylvania
Read R&N Ch Next lecture: Read R&N
Bayesian Networks Probability In AI.
Read R&N Ch Next lecture: Read R&N
Probabilistic Reasoning; Network-based reasoning
CS 188: Artificial Intelligence Fall 2007
Bayesian networks Chapter 14 Section 1 – 2.
Probabilistic Reasoning
Read R&N Ch Next lecture: Read R&N
Presentation transcript:

Bayesian Networks

Motivation The conditional independence assumption made by naïve Bayes classifiers may seem to rigid, especially for classification problems in which the attributes are somewhat correlated. We talk today for a more flexible approach for modeling the conditional probabilities.

Naïve Bayes and Correlated Attrs Two binary attributes A and B, and a binary class Y. A distribution –P(A=0 | Y=0) = 0.4P(A=1 | Y=0) = 0.6 –P(A=0 | Y=1) = 0.6P(A=1 | Y=1) = 0.4 B is perfectly correlated with A when Y=0, but not when Y=1 –P(B=0 | Y=0) = 0.4P(B=1 | Y=0) = 0.6 –P(B=0 | Y=1) = 0.5P(B=1 | Y=1) = 0.5 Also, let’s assume –P(Y=0) = P(Y=1) = 0.5

Naïve Bayes and Correlated Attrs Now, we are given a new record with A=0 and B=0. Using Naïve Bayes we have: P(Y=0 | A=0, B=0) =  * P(A=0 | Y=0) * P(B=0 | Y=0) * P(Y=0) =  *.4 *.4 *.5 =  * 0.08 P(Y=1 | A=0, B=0) =  * P(A=0 | Y=1) * P(B=0 | Y=1) * P(Y=1) =  *.6 *.5 *.5 =  *.15 So, we predict Y=1.

Naïve Bayes and Correlated Attrs However, since A and B are perfectly correlated (when Y=0) we have that: P(A=0, B=0 | Y=0) = P(A=0 | Y=0) = 0.4 Thus, P(Y=0 | A=0, B=0) =  * P(A=0, B=0 | Y=0) * P(Y=0) =  * 0.4 * 0.5 =  * 0.2 which is greater than P(Y=1 | A=0, B=0) =  * P(A=0 | Y=1) * P(B=0 | Y=1) * P(Y=1) =  *.6 *.5 *.5 =  *.15 So, the record should have been classified as class 0.

Bayesian networks A simple, graphical notation for conditional independence assertions. Syntax: a set of nodes, one per variable (attribute) a directed, acyclic graph (link means: "directly influences") a conditional distribution for each node given its parents: P (X i | Parents (X i )) The conditional distribution is represented as a conditional probability table (CPT) giving the distribution over X i for each combination of parent values.

Example (Perls’ example) I'm at work, neighbor John calls to say my alarm is ringing, but neighbor Mary doesn't call. Sometimes it's set off by minor earthquakes. Is there a burglar? John always calls when he hears the alarm, but sometimes confuses the telephone ringing with the alarm. Mary likes rather loud music and sometimes misses the alarm. Variables: Burglary, Earthquake, Alarm, JohnCalls, MaryCalls Network topology reflects "causal" knowledge: –A burglar can set the alarm off –An earthquake can set the alarm off –The alarm can cause Mary to call –The alarm can cause John to call

Example cont’d The topology shows that burglary and earthquakes directly affect the probability of alarm, but whether Mary or John call depends only on the alarm. Thus our assumptions are that they don’t perceive any burglaries directly, and they don’t confer before calling. To save space, some of the probabilities have been omitted from the diagram. The omitted probabilities can be recovered by noting that P(X = x) = 1 - P(X =  x) and P(X =  x|Y) = 1 - P(X=  x|Y), where  x denotes the opposite outcome of x.

Semantics e.g., P(j  m  a   b   e) = P(j | a) P(m | a) P(a |  b,  e) P(  b) P(  e) = … Suppose we have the variables X 1,…,X n. The probability for them to have the values x 1,…,x n respectively is P(x n,…,x 1 ): P(x n,…,x 1 ): is short for P(X n =x n,…, X n = x 1 ):

Inference in Bayesian Networks The basic task for a probabilistic inference system is to compute the posterior probability for a query variable (class attribute), given some observed event –that is, some assignment of values to a set of evidence variables (some of the other attributes). Notation: –X denotes query variable –E denotes the set of evidence variables E 1,…,E m, and e is a particular event, i.e. an assignment to the variables in E. –Y will denote the set of the remaining variables (hidden variables). A typical query asks for the posterior probability P(x|e 1,…,e m ) E.g. We could ask: What’s the probability of a burglary if both Mary and John call, P(burglary | johhcalls, marycalls)?

Classification Suppose, we are given for the evidence variables E 1,…,E m, their values e 1,…,e m, and we want to predict whether the query variable X has the value x or not. For this we compute and compare the following: However, how do we compute: What about the hidden variables Y 1,…,Y k ?

Inference by enumeration Example: P(burglary | johhcalls, marycalls)? (Abbrev. P(b|j,m)) In general:

Numerically… P(b | j,m) =  P(b)  a P(j|a)P(m|a)  e P(a|b,e)P(e) = …=  * P(  b | j,m) =  P(  b)  a P(j|a)P(m|a)  e P(a|  b,e)P(e) = …=  * P(B | j,m) =  =.

P(b | j,m) P(b | j,m) =  P(b)  a P(j|a)P(m|a)  e P(a|b,e)P(e) =  P(b)  a P(j|a)P(m|a)(P(a|b,e)P(e) + P(a|b,  e)P(  e)) =  P(b)( P(j|a)P(m|a)( P(a|b,e)P(e) + P(a|b,  e)P(  e) ) + P(j|  a)P(m|  a)( P(  a|b,e)P(e) + P(  a|b,  e)P(  e) )) =  *.001*(.9*.7*(.95* *.998) +.05*.01*(.05* *.998) ) =  *.00059

P(  b | j,m) P(  b | j,m) =  P(  b)  a P(j|a)P(m|a)  e P(a|  b,e)P(e) =  P(  b)  a P(j|a)P(m|a)(P(a|  b,e)P(e) + P(a|  b,  e)P(  e)) =  P(  b)( P(j|a)P(m|a)( P(a|  b,e)P(e) + P(a|  b,  e)P(  e) ) + P(j|  a)P(m|  a)( P(  a|  b,e)P(e) + P(  a|  b,  e)P(  e) )) =  *.999*(.9*.7*(.29* *.998) +.05*.01*(.71* *.998) ) =  *.0015  = 1/( ) = P(b | j,m) = * =.28 P(  b | j,m) = *.0015 =.72

Constructing Bayesian networks 1. Choose an ordering of variables X 1, …,X n 2. For i = 1 to n –add X i to the network –select parents from X 1, …,X i-1 such that P(X i | Parents(X i )) = P(X i | X 1,... X i-1 ) This choice of parents guarantees: P(X 1, …,X n ) =  i =1 P(X i | X 1, …, X i-1 ) (chain rule) =  i =1 P(X i | Parents(X i )) (by construction) Choosing the parents from X 1, …, X i-1 is done by domain human experts.

The ordering of variables is very important. E.g. suppose we choose the ordering M, J, A, B, E Adding MaryCalls: No parents P (J|M) = P (J)? Is P(John calling) independent of P(Mary calling)? Clearly not, since, on any given day, if Mary called, then the probability that John called is much better than the background probability that he called. So, we add a link from MaryCalls to JohnCalls. Example

Suppose we choose the ordering M, J, A, B, E Adding the A (Alarm) node: Is P(A | J, M) = P(A | J)? P(A | J, M) = P(A)? No. Clearly, if both call, it’s more likely that the alarm has gone off that if just one or neither call, so we need both MaryCalls and JohnCalls as parents. Example

Suppose we choose the ordering M, J, A, B, E Adding B (Burglary) node: Is P(B | A, J, M) = P(B | A)? P(B | A, J, M) = P(B)? Yes for the first. No for the second. If we know the alarm state, then the call from John or Mary might give us information about the phone ringing or Mary’s music, but not about burglary. So, we need just Alarm as parent. Example

Suppose we choose the ordering M, J, A, B, E Adding E (Earthquake) node: Is P(E | B, A,J, M) = P(E | A)? P(E | B, A, J, M) = P(E | A, B)? No for the first. Yes for the second. If the alarm is on, it is more likely that there has been an earthquake. But if we know there has been a burglary, then that explains the alarm, and the probability of an earthquake would be only slightly above normal. Hence we need both Alarm and Burglary as parents. Example

Example cont’d So, the n etwork is less compact if we go non-causal: = 13 numbers needed instead of 10 if we go in causal direction. Deciding conditional independence is harder in noncausal directions Causal models and conditional independence seem hardwired for humans!