Ch13 Uncertainty Converted
Ch13 Uncertainty Converted
Chapter 5
Artificial Intelligence
This Lecture
• Probability
• Syntax
• Semantics
• Inference rules
• How to build a Naïve Bayes classifier
Fuzzy Logic in Real World
Probability
Probabilistic assertions summarize effects of
Ignorance: lack of relevant facts, initial conditions, etc.
Laziness: failure to enumerate exceptions, qualifications, etc.
These are NOT assertions about the world, but represent belief about the
whether the assertion is true.
Note: To make things confusing variables have first letter upper-case, and
symbol values are lower-case
Each entry is just the product of the marginals (because they’re independent)!
So, instead of using 7 numbers, we can represent these by just recording 4
numbers, 3 from Weather and 1 from Cavity:
Weather is one of <sunny,rain,cloudy,snow>
P(Weather) = <0.72, 0.1, 0.08, (1- Sum of the others)>
P(Cavity) = <.1, (1-.1)>
This can be much more efficient (more later…)
Conditional Probabilities
• Conditional or posterior probabilities
e.g., P(Cavity | Toothache) = 0.8
What is the probability of having a cavity given that the patient has a
toothache? (as another example: P(Male | CS151Student) = ??
Example:
P(Male)= 0.5
P(CS151Student) = 0.0037
P(Male | CS151Student) = 0.9
P(B | A)P( A)
P( A | B)
P(B)
P(Effect |
P(Cause | Effect)
Cause)P(Cause)
P(Effect)
Bayes Rule: Example
P(Effect| Cause)P(Cause)
P(Cause | Effect)
P ( Effect )
P(S |
P(M | S )
M )P(M ) 0.8
0.0001
0.0008
Bayes Rule: Another Example
Let A be AIDS, T be positive test result for AIDS
P(T|A)=0.99 “true positive” rate of test (aka a “hit”)
P(T|~A)= 0.005 “false positive” rate of test (aka a “false alarm”)
P(~T | A) = 1-0.99=.01 “false negative” or “miss”
P(~T|~A) = 0.995 “correct rejection”
P(B | A, E)P( A | E)
P( A | B, E)
P(B | E)
Full joint distributions
A complete probability model specifies every entry in the
joint distribution for all the variablesX = X1, ..., Xn
i.e., a probability for each possible world X1= x1, ..., Xn=
xn
P(Cavity Toothache)
= P(Cavity,Toothache) + P(Cavity, ~Toothache) + P(~Cavity,Toothache)
= 0.04 + 0.06 + 0.01 = 0.11
Using the full joint distribution
Toothache=true Toothache = false
Cavity=true 0.04 0.06
Cavity=false 0.01 0.89
(from *)
= P(Toothache|Cavity)
P(Toothache,Catch | Cavity)
= P(Toothache | Catch,Cavity)
b. P(Toothache,Catch|Cavity) P(Catch | Cavity) (product rule)
= P(Toothache|
= P(Toothache | Cavity) P(Catch | Cavity)
Cavity)P(Catch|Cavity) (from 1a)
Using Conditional Independence
Full joint distribution can now be written as
P(Toothache,Catch,Cavity)
= (Toothache,Catch | Cavity) P(Cavity)
= P(Toothache | Cavity)P(Catch | Cavity)P(Cavity) (from 1.b)