Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS 416 Artificial Intelligence Lecture 13 Uncertainty Chapter 13 Lecture 13 Uncertainty Chapter 13.

Similar presentations


Presentation on theme: "CS 416 Artificial Intelligence Lecture 13 Uncertainty Chapter 13 Lecture 13 Uncertainty Chapter 13."— Presentation transcript:

1 CS 416 Artificial Intelligence Lecture 13 Uncertainty Chapter 13 Lecture 13 Uncertainty Chapter 13

2 Midterm March 16 th See class web page for old tests and study guide March 16 th See class web page for old tests and study guide

3 Shortcomings of first-order logic Consider dental diagnosis –Not all patients with toothaches have cavities.  There are other outcomes of toothaches Consider dental diagnosis –Not all patients with toothaches have cavities.  There are other outcomes of toothaches

4 Shortcomings of first-order logic What’s wrong with this? An unlimited number of toothache implicationsAn unlimited number of toothache implications What’s wrong with this? An unlimited number of toothache implicationsAn unlimited number of toothache implications

5 Shortcomings of first-order logic Alternatively, create a causal rule Again, not all cavities cause pain. Must expandAgain, not all cavities cause pain. Must expand Alternatively, create a causal rule Again, not all cavities cause pain. Must expandAgain, not all cavities cause pain. Must expand

6 Shortcomings of first-order logic Both diagnostic and causal rules require countless qualifications Difficult to be exhaustiveDifficult to be exhaustive –Too much work –We don’t know all the qualifications –Even correctly qualified rules may not be useful if the real- time application of the rules is missing data Both diagnostic and causal rules require countless qualifications Difficult to be exhaustiveDifficult to be exhaustive –Too much work –We don’t know all the qualifications –Even correctly qualified rules may not be useful if the real- time application of the rules is missing data

7 Shortcomings of first-order logic As an alternative to exhaustive logic… Probability Theory Serves as a hedge against our laziness and ignoranceServes as a hedge against our laziness and ignorance As an alternative to exhaustive logic… Probability Theory Serves as a hedge against our laziness and ignoranceServes as a hedge against our laziness and ignorance

8 Degrees of belief I believe the glass is full with 50% chance Note this does not indicate the statement is half-trueNote this does not indicate the statement is half-true –We are not talking about a glass half-full “The glass is full” is the only statement being considered“The glass is full” is the only statement being considered My statement indicates I believe with 50% that the statement is true. There are no claims about what other beliefs I have regarding the glass.My statement indicates I believe with 50% that the statement is true. There are no claims about what other beliefs I have regarding the glass. –Fuzzy logic handles partial-truths I believe the glass is full with 50% chance Note this does not indicate the statement is half-trueNote this does not indicate the statement is half-true –We are not talking about a glass half-full “The glass is full” is the only statement being considered“The glass is full” is the only statement being considered My statement indicates I believe with 50% that the statement is true. There are no claims about what other beliefs I have regarding the glass.My statement indicates I believe with 50% that the statement is true. There are no claims about what other beliefs I have regarding the glass. –Fuzzy logic handles partial-truths

9 Decision Theory What is rational behavior in context of probability? Pick answer that satisfies goals with highest probability of actually working?Pick answer that satisfies goals with highest probability of actually working? –Sometimes more risk is acceptable Must have a utility function that measures the many factors related to an agent’s happiness with an outcomeMust have a utility function that measures the many factors related to an agent’s happiness with an outcome An agent is rational if and only if it chooses the action that yields the highest expected utility, averaged over all the possible outcomes of the actionAn agent is rational if and only if it chooses the action that yields the highest expected utility, averaged over all the possible outcomes of the action What is rational behavior in context of probability? Pick answer that satisfies goals with highest probability of actually working?Pick answer that satisfies goals with highest probability of actually working? –Sometimes more risk is acceptable Must have a utility function that measures the many factors related to an agent’s happiness with an outcomeMust have a utility function that measures the many factors related to an agent’s happiness with an outcome An agent is rational if and only if it chooses the action that yields the highest expected utility, averaged over all the possible outcomes of the actionAn agent is rational if and only if it chooses the action that yields the highest expected utility, averaged over all the possible outcomes of the action

10 Building probability notation Propositions Like propositional logic. The things we believeLike propositional logic. The things we believe Atomic Events A complete specification of the state of the worldA complete specification of the state of the world Prior Probability Probability something is true in absence of other dataProbability something is true in absence of other data Conditional Probability Probability something is true given something else is knownProbability something is true given something else is knownPropositions Like propositional logic. The things we believeLike propositional logic. The things we believe Atomic Events A complete specification of the state of the worldA complete specification of the state of the world Prior Probability Probability something is true in absence of other dataProbability something is true in absence of other data Conditional Probability Probability something is true given something else is knownProbability something is true given something else is known

11 Propositions Assertions that “such and such is true” Random variables refer to parts of the world with unknown statusRandom variables refer to parts of the world with unknown status Random variables have a well-defined domainRandom variables have a well-defined domain –Boolean, P(Heads) –Discrete (countable), P (Whether = Sunny) –Continuous, P (Speed = 55.0 mph) Assertions that “such and such is true” Random variables refer to parts of the world with unknown statusRandom variables refer to parts of the world with unknown status Random variables have a well-defined domainRandom variables have a well-defined domain –Boolean, P(Heads) –Discrete (countable), P (Whether = Sunny) –Continuous, P (Speed = 55.0 mph)

12 Atomic events A complete specification of the world All variables in the world are assigned valuesAll variables in the world are assigned values Only one atomic event can be trueOnly one atomic event can be true The set of all atomic events is exhaustiveThe set of all atomic events is exhaustive Any atomic event entails the truth or falsehood of every propositionAny atomic event entails the truth or falsehood of every proposition A complete specification of the world All variables in the world are assigned valuesAll variables in the world are assigned values Only one atomic event can be trueOnly one atomic event can be true The set of all atomic events is exhaustiveThe set of all atomic events is exhaustive Any atomic event entails the truth or falsehood of every propositionAny atomic event entails the truth or falsehood of every proposition

13 Prior probability The degree of belief in the absence of other info P (Weather)P (Weather) –P (Weather == sunny)= 0.7 –P (Weather == rainy)= 0.2 –P (Weather == cloudy)= 0.08 –P (Weather == snowy)= 0.02 P (Weather) = P (Weather) = –Probability distribution for the random variable Weather The degree of belief in the absence of other info P (Weather)P (Weather) –P (Weather == sunny)= 0.7 –P (Weather == rainy)= 0.2 –P (Weather == cloudy)= 0.08 –P (Weather == snowy)= 0.02 P (Weather) = P (Weather) = –Probability distribution for the random variable Weather

14 Prior probability - Discrete Joint probability distribution P (Weather, Natural Disaster) = an n x m table of probsP (Weather, Natural Disaster) = an n x m table of probs –n = instances of weather –m = instances of natural disasters Full joint probability distribution Probabilities for all variables are establishedProbabilities for all variables are established What about continuous variables where a table won’t suffice? Joint probability distribution P (Weather, Natural Disaster) = an n x m table of probsP (Weather, Natural Disaster) = an n x m table of probs –n = instances of weather –m = instances of natural disasters Full joint probability distribution Probabilities for all variables are establishedProbabilities for all variables are established What about continuous variables where a table won’t suffice?

15 Prior probability - Continuous Probability density functions (PDFs) P (X = x) = Uniform [18, 26] (x)P (X = x) = Uniform [18, 26] (x) –The probability that tomorrow’s temperature is 20.5 degrees Celsius is U [18, 26] (20.5) = 0.125 Probability density functions (PDFs) P (X = x) = Uniform [18, 26] (x)P (X = x) = Uniform [18, 26] (x) –The probability that tomorrow’s temperature is 20.5 degrees Celsius is U [18, 26] (20.5) = 0.125

16 Conditional probability The probability of a given all we know is b P (a | b)… P(cavity | toothache) = 0.8P (a | b)… P(cavity | toothache) = 0.8 Written as an unconditional probability The probability of a given all we know is b P (a | b)… P(cavity | toothache) = 0.8P (a | b)… P(cavity | toothache) = 0.8 Written as an unconditional probability

17 Axioms of probability All probabilities are between 0 and 1All probabilities are between 0 and 1 Necessarily true propositions have probability 1 Necessarily false propositions have probability 0Necessarily true propositions have probability 1 Necessarily false propositions have probability 0 The probability of disjunction is:The probability of disjunction is: All probabilities are between 0 and 1All probabilities are between 0 and 1 Necessarily true propositions have probability 1 Necessarily false propositions have probability 0Necessarily true propositions have probability 1 Necessarily false propositions have probability 0 The probability of disjunction is:The probability of disjunction is:

18 Using axioms of probability The probability of a proposition is equal to the sum of the probabilities of the atomic events in which it holds:

19 An example Maginalization:Conditioning:Maginalization:Conditioning:

20 Conditional probabilities

21

22 Normalization Two previous calculations had the same denominator P(cavity | toothache) =  P(cavity, toothache)P(cavity | toothache) =  P(cavity, toothache) –=  [P(cavity, toothache, catch) + P(cavity, toothache, ~catch)] –=  [ + ] =  = –=  [ + ] =  = Generalized (X = cavity, e = toothache, y = catch) P (X, e, y) is a subset of the full joint distribution Two previous calculations had the same denominator P(cavity | toothache) =  P(cavity, toothache)P(cavity | toothache) =  P(cavity, toothache) –=  [P(cavity, toothache, catch) + P(cavity, toothache, ~catch)] –=  [ + ] =  = –=  [ + ] =  = Generalized (X = cavity, e = toothache, y = catch) P (X, e, y) is a subset of the full joint distribution

23 Using the full joint distribution It does not scale well… n Boolean variablesn Boolean variables –Table size O (2 n ) –Process time O (2 n ) It does not scale well… n Boolean variablesn Boolean variables –Table size O (2 n ) –Process time O (2 n )

24 Independence Independence of variables in a domain can dramatically reduce the amount of information necessary to specify the full joint distribution Adding weather (four states) to this table requires creating four versions of it (one for each weather state) = 8*4=32 cellsAdding weather (four states) to this table requires creating four versions of it (one for each weather state) = 8*4=32 cells Independence of variables in a domain can dramatically reduce the amount of information necessary to specify the full joint distribution Adding weather (four states) to this table requires creating four versions of it (one for each weather state) = 8*4=32 cellsAdding weather (four states) to this table requires creating four versions of it (one for each weather state) = 8*4=32 cells

25 Independence P (toothache, catch, cavity, Weather=cloudy) = P(Weather=cloudy | toothache, catch, cavity) * P(toothache, catch, cavity)P (toothache, catch, cavity, Weather=cloudy) = P(Weather=cloudy | toothache, catch, cavity) * P(toothache, catch, cavity) Because weather and dentistry are independent P (Weather=cloudy | toothache, catch, cavity) = P (Weather = cloudy)P (Weather=cloudy | toothache, catch, cavity) = P (Weather = cloudy) P (toothache, catch, cavity, Weather=cloudy) = P(Weather=cloudy) * P(toothache, catch, cavity) 4-cell table 8-cell tableP (toothache, catch, cavity, Weather=cloudy) = P(Weather=cloudy) * P(toothache, catch, cavity) 4-cell table 8-cell table P (toothache, catch, cavity, Weather=cloudy) = P(Weather=cloudy | toothache, catch, cavity) * P(toothache, catch, cavity)P (toothache, catch, cavity, Weather=cloudy) = P(Weather=cloudy | toothache, catch, cavity) * P(toothache, catch, cavity) Because weather and dentistry are independent P (Weather=cloudy | toothache, catch, cavity) = P (Weather = cloudy)P (Weather=cloudy | toothache, catch, cavity) = P (Weather = cloudy) P (toothache, catch, cavity, Weather=cloudy) = P(Weather=cloudy) * P(toothache, catch, cavity) 4-cell table 8-cell tableP (toothache, catch, cavity, Weather=cloudy) = P(Weather=cloudy) * P(toothache, catch, cavity) 4-cell table 8-cell table

26 Bayes’ Rule Useful when you know three things and need to know the fourth

27 Example Meningitis Doctor knows meningitis causes stiff necks 50% of the timeDoctor knows meningitis causes stiff necks 50% of the time Doctor knows unconditional factsDoctor knows unconditional facts –The probability of having meningitis is 1 / 50,000 –The probability of having a stiff neck is 1 / 20 The probability of having meningitis given a stiff neck:The probability of having meningitis given a stiff neck:Meningitis Doctor knows meningitis causes stiff necks 50% of the timeDoctor knows meningitis causes stiff necks 50% of the time Doctor knows unconditional factsDoctor knows unconditional facts –The probability of having meningitis is 1 / 50,000 –The probability of having a stiff neck is 1 / 20 The probability of having meningitis given a stiff neck:The probability of having meningitis given a stiff neck:

28 Power of Bayes’ rule Why not collect more diagnostic evidence? Statistically sample to learn P (m | s) = 1 / 5,000Statistically sample to learn P (m | s) = 1 / 5,000 If P(m) changes… due to outbreak… Bayes’ computation adjusts automatically, but sampled P(m | s) is rigid Why not collect more diagnostic evidence? Statistically sample to learn P (m | s) = 1 / 5,000Statistically sample to learn P (m | s) = 1 / 5,000 If P(m) changes… due to outbreak… Bayes’ computation adjusts automatically, but sampled P(m | s) is rigid

29 Conditional independence Consider the infeasibility of full joint distributions We must know P(toothache and catch) for all Cavity valuesWe must know P(toothache and catch) for all Cavity values Simplify using independence Toothache and catch are not independentToothache and catch are not independent Toothache and catch are independent given the presence or absence of a cavityToothache and catch are independent given the presence or absence of a cavity Consider the infeasibility of full joint distributions We must know P(toothache and catch) for all Cavity valuesWe must know P(toothache and catch) for all Cavity values Simplify using independence Toothache and catch are not independentToothache and catch are not independent Toothache and catch are independent given the presence or absence of a cavityToothache and catch are independent given the presence or absence of a cavity

30 Conditional independence Toothache and catch are independent given the presence or absence of a cavity If you know you have a cavity, there’s no reason to believe the toothache and the dentist’s pick are relatedIf you know you have a cavity, there’s no reason to believe the toothache and the dentist’s pick are related Toothache and catch are independent given the presence or absence of a cavity If you know you have a cavity, there’s no reason to believe the toothache and the dentist’s pick are relatedIf you know you have a cavity, there’s no reason to believe the toothache and the dentist’s pick are related

31 Conditional independence In general, when a single cause influences multiple effects, all of which are conditionally independent (given the cause)

32 Naïve Bayes Even when “effect” variables are not conditionally independent, this model is sometimes used Sometimes called a Bayesian ClassifierSometimes called a Bayesian Classifier Even when “effect” variables are not conditionally independent, this model is sometimes used Sometimes called a Bayesian ClassifierSometimes called a Bayesian Classifier


Download ppt "CS 416 Artificial Intelligence Lecture 13 Uncertainty Chapter 13 Lecture 13 Uncertainty Chapter 13."

Similar presentations


Ads by Google