Uncertainty in Expert
Systems : Certainty
Factor
1
Uncertainty
• Uncertainty is the lack of exact knowledge that
would enable us to reach a fully reliable solution.
o Classical logic assumes perfect knowledge exists:
IF A is true
THEN B is true
• Describing uncertainty:
o If the antecedence A is true, then consequent B is
true to a certain probability
2
Sources of uncertainty
• Weak implications: Want to be able to capture
associations and correlations, not just cause and
effect.
• Imprecise language:
o How often is “sometimes”?
o Can we quantify “often,” “sometimes,” “always?”
• Unknown data: In real problems, data is often
incomplete or missing.
• Differing experts: Experts often disagree, or have
different reasons for agreeing.
o Solution: attach weight to each expert 3
Two approaches
• Bayesian reasoning – Bayesian rule
- (Probability theory)
• Certainty factors
- Difference between belief and disbelief.
4
Certainty factors
• Certainty factor (CF) is an alternative to
Bayesian method of dealing with uncertainty.
This method was originally developed for the
MYCIN system.
• CF was originally defined as the difference
between belief and disbelief.
5
• In formula form:
where
o CF is the certainty factor in the hypothesis H due to
evidence E
o MB is the measure of increased belief in H due to E
o MD is the measure of increased disbelief in H due
to E
6
• p(H) is the prior probability of hypothesis H being true;
• p(H|E) is the probability that hypothesis H is true given
evidence E.
7
• According to CF definition, we can deduce some
of its characteristics
8
Interpreting uncertainty
9
• A positive CF means the evidence supports the hypothesis
since MB > MD.
• A CF = 1 means that the evidence definitely proves the
hypothesis.
• A negative CF means that there is more reason to disbelief a
hypothesis than to belief it.
example, a CF = - 0.7 means that the disbelief is 70%
greater than the belief.
• A CF = 0 means one of two possibilities. First, a CF = MB - MD
= 0 could mean that both MB and MD are 0, second both are
having same nonzero value, where in either cases, the belief is
canceled out by the disbelief.
10
• CF is a way of combining belief and disbelief into
a single number.
• The certainty factor can be used to rank
hypothesis in order of importance.
• For example, If a patient has certain symptoms
which suggest several possible diseases, then
the disease with the highest CF would be the
one that is first investigated by ordering tests.
11
• The certainty factor assigned by a rule is propagated
through the reasoning chain.
• This involves establishing the net certainty of the rule
consequent when the evidence in the rule antecedent is
uncertain:
cf (H,E) = cf (E) x cf
For example,
IF sky is clear
THEN the forecast is sunny {cf 0.8}
given the current certainty factor of sky is clear is 0.5,
then cf (H,E) = 0.5 × 0.8 = 0.4
This result can be interpreted as “It may be sunny”.
12
Combining Certainty Factors
• For conjunctive rules such as
the certainty of hypothesis H, is established as follows:
𝑐𝑓 𝐻, 𝐸1 ∩ 𝐸2 ∩ 𝐸3 … ∩ 𝐸𝑛 = min [cf (E1), cf (E2),..., cf (En)] x cf
For example,
IF sky is clear
AND the forecast is sunny
THEN the action is ‘wear sunglasses’ {cf 0.8}
and the certainty of sky is clear is 0.9 and the certainty of the
forecast of sunny is 0.7, then
𝑐𝑓(𝐻, 𝐸1 ∩ 𝐸2) = min [0.9, 0.7] × 0.8 = 0.7 × 0.8 = 0.56
13
• For disjunctive rules such as
the certainty of hypothesis H, is established as follows:
𝑐𝑓 𝐻, 𝐸1 ∪ 𝐸2 ∪ 𝐸3 … ∪ 𝐸𝑛 = max [cf (E1), cf (E2),..., cf (En)] x cf
For example,
IF sky is overcast
OR the forecast is rain
THEN the action is ‘take an umbrella’ {cf 0.9}
and the certainty of sky is overcast is 0.6 and the certainty of
the forecast of rain is 0.8, then
𝑐𝑓(𝐻, 𝐸1 ∪ 𝐸2) = = max [0.6, 0.8] × 0.9 = 0.8 × 0.9 = 0.72
14
• Multiple Rules with Same Conclusion
Suppose we have two rules R1 and R2 with the same conclusion
Z
Rule 1: IF A is X
THEN C is Z {cf 0.8}
Rule 2: IF B is Y
THEN C is Z {cf 0.6}
What certainty should be assigned to object C having value Z
if both Rule 1 and Rule 2 are fired?
15
• Multiple Rules with Same Conclusion
To calculate a combined certainty factor we can use the following
equation:
where:
cf1 is the confidence in hypothesis H established by Rule 1;
cf2 is the confidence in hypothesis H established by Rule 2;
|cf1| and |cf2| are absolute magnitudes of cf1 and cf2,
respectively.
16
Example 1
Consider the previous rules:
Rule 1: IF A is X
THEN C is Z {cf 0.8}
Rule 2: IF B is Y
THEN C is Z {cf 0.6}
if we assume that
𝑐𝑓 𝐸1 = 𝑐𝑓 𝐸2 = 1
17
Consider the previous rules:
𝑐𝑓1 𝐻, 𝐸1 = 𝑐𝑓 𝐸1 × 𝑐𝑓 = 1.0 × 0.8 = 0.8
𝑐𝑓2 𝐻, 𝐸2 = 𝑐𝑓 𝐸2 × 𝑐𝑓 = 1.0 × 0.6 = 0.6
From the equation we obtain
𝑐𝑓 𝑐𝑓1, 𝑐𝑓2 = 𝑐𝑓1 𝐻, 𝐸1 + 𝑐𝑓2 𝐻, 𝐸2 − [1 − 𝑐𝑓1 𝐻, 𝐸1 ]
= 0.92
18
Again Consider the previous rules:
Rule 1: IF A is X
THEN C is Z {cf 0.8}
Rule 2: IF B is Y
THEN C is Z {cf 0.6}
Now, if we assume that
𝑐𝑓 𝐸1 = 1, 𝑐𝑓 𝐸2 = −1
19
Consider the previous rules:
𝑐𝑓1 𝐻, 𝐸1 = 𝑐𝑓 𝐸1 × 𝑐𝑓 = 1.0 × 0.8 = 0.8
𝑐𝑓2 𝐻, 𝐸2 = 𝑐𝑓 𝐸2 × 𝑐𝑓 = −1.0 × 0.6 = −0.6
From the equation we obtain
𝑐𝑓 𝑐𝑓1, 𝑐𝑓2 =
𝑐𝑓1 𝐻, 𝐸1 + 𝑐𝑓2 𝐻, 𝐸2
1 − min[ 𝑐𝑓1 𝐻, 𝐸1 , 𝑐𝑓1 𝐻, 𝐸1 ]
= 0.5
The combined certainty factor now drop because one
evidence confirms a hypothesis but another discounts it.
20
Example 2
• We have the following rules
R1: if a and b then x (cf = 0.5)
R2: if c or d then x (cf = 0.7)
• We have the following Input:
a, with certainty 1.0
b, with certainty 0.8
c, with certainty 0.9
d, with certainty 0.7
Then, Compute CF values for x:
21
• CF(a and b) = MIN{1.0, 0.8} = 0.8
==> CF1(x) = 0.8 * 0.5 = 0.4
• CF(c or d) = MAX{0.9, 0.7} = 0.9
==> CF2(x) = 0.9 * 0.7 = 0.63
• CF(CF1, CF2) = 0.4 + 0.63 - 0.4*0.63 = 0.778
22
Example 3
• Suppose we have the following rule R1:
if (P1 and P2 and P3) or (P4 and not P5 then C1 (0.7)
and C2 (-0.5)
• Given the certainty factors of P1, P2, P3, P4, P5 are as follows:
CF(P1) = 0.8,
CF(P2) = 0.7,
CF(P3) = 0.6,
CF(P4) = 0.9,
CF(P5) = -0.5,
• What are the certainty factors associated with conclusions C1
and C2 after using rule R1?
23
• Solution:
For P1 and P2 and P3, the CF is
min(CF(P1), CF(P2), CF(P3)) = min(0.8, 0.7, 0.6) = 0.6.
Call this CFA.
For not P5, the CF is -CF(P5) = 0.5.
For P4 and not P5, the CF is min(0.9, 0.5) = 0.5.
Call this CFB.
For (P1 and P2 and P3) or (P4 and not P5), the CF is:
max(CFA, CFB) = max(0.6, 0.5) = 0.6.
Thus
CF(C1) = 0.7 * 0.6 = 0.42
CF(C2) = -0.5 * 0.6 = -0.30
24

uncertainty management - certainty factor.pptx

  • 1.
    Uncertainty in Expert Systems: Certainty Factor 1
  • 2.
    Uncertainty • Uncertainty isthe lack of exact knowledge that would enable us to reach a fully reliable solution. o Classical logic assumes perfect knowledge exists: IF A is true THEN B is true • Describing uncertainty: o If the antecedence A is true, then consequent B is true to a certain probability 2
  • 3.
    Sources of uncertainty •Weak implications: Want to be able to capture associations and correlations, not just cause and effect. • Imprecise language: o How often is “sometimes”? o Can we quantify “often,” “sometimes,” “always?” • Unknown data: In real problems, data is often incomplete or missing. • Differing experts: Experts often disagree, or have different reasons for agreeing. o Solution: attach weight to each expert 3
  • 4.
    Two approaches • Bayesianreasoning – Bayesian rule - (Probability theory) • Certainty factors - Difference between belief and disbelief. 4
  • 5.
    Certainty factors • Certaintyfactor (CF) is an alternative to Bayesian method of dealing with uncertainty. This method was originally developed for the MYCIN system. • CF was originally defined as the difference between belief and disbelief. 5
  • 6.
    • In formulaform: where o CF is the certainty factor in the hypothesis H due to evidence E o MB is the measure of increased belief in H due to E o MD is the measure of increased disbelief in H due to E 6
  • 7.
    • p(H) isthe prior probability of hypothesis H being true; • p(H|E) is the probability that hypothesis H is true given evidence E. 7
  • 8.
    • According toCF definition, we can deduce some of its characteristics 8
  • 9.
  • 10.
    • A positiveCF means the evidence supports the hypothesis since MB > MD. • A CF = 1 means that the evidence definitely proves the hypothesis. • A negative CF means that there is more reason to disbelief a hypothesis than to belief it. example, a CF = - 0.7 means that the disbelief is 70% greater than the belief. • A CF = 0 means one of two possibilities. First, a CF = MB - MD = 0 could mean that both MB and MD are 0, second both are having same nonzero value, where in either cases, the belief is canceled out by the disbelief. 10
  • 11.
    • CF isa way of combining belief and disbelief into a single number. • The certainty factor can be used to rank hypothesis in order of importance. • For example, If a patient has certain symptoms which suggest several possible diseases, then the disease with the highest CF would be the one that is first investigated by ordering tests. 11
  • 12.
    • The certaintyfactor assigned by a rule is propagated through the reasoning chain. • This involves establishing the net certainty of the rule consequent when the evidence in the rule antecedent is uncertain: cf (H,E) = cf (E) x cf For example, IF sky is clear THEN the forecast is sunny {cf 0.8} given the current certainty factor of sky is clear is 0.5, then cf (H,E) = 0.5 × 0.8 = 0.4 This result can be interpreted as “It may be sunny”. 12
  • 13.
    Combining Certainty Factors •For conjunctive rules such as the certainty of hypothesis H, is established as follows: 𝑐𝑓 𝐻, 𝐸1 ∩ 𝐸2 ∩ 𝐸3 … ∩ 𝐸𝑛 = min [cf (E1), cf (E2),..., cf (En)] x cf For example, IF sky is clear AND the forecast is sunny THEN the action is ‘wear sunglasses’ {cf 0.8} and the certainty of sky is clear is 0.9 and the certainty of the forecast of sunny is 0.7, then 𝑐𝑓(𝐻, 𝐸1 ∩ 𝐸2) = min [0.9, 0.7] × 0.8 = 0.7 × 0.8 = 0.56 13
  • 14.
    • For disjunctiverules such as the certainty of hypothesis H, is established as follows: 𝑐𝑓 𝐻, 𝐸1 ∪ 𝐸2 ∪ 𝐸3 … ∪ 𝐸𝑛 = max [cf (E1), cf (E2),..., cf (En)] x cf For example, IF sky is overcast OR the forecast is rain THEN the action is ‘take an umbrella’ {cf 0.9} and the certainty of sky is overcast is 0.6 and the certainty of the forecast of rain is 0.8, then 𝑐𝑓(𝐻, 𝐸1 ∪ 𝐸2) = = max [0.6, 0.8] × 0.9 = 0.8 × 0.9 = 0.72 14
  • 15.
    • Multiple Ruleswith Same Conclusion Suppose we have two rules R1 and R2 with the same conclusion Z Rule 1: IF A is X THEN C is Z {cf 0.8} Rule 2: IF B is Y THEN C is Z {cf 0.6} What certainty should be assigned to object C having value Z if both Rule 1 and Rule 2 are fired? 15
  • 16.
    • Multiple Ruleswith Same Conclusion To calculate a combined certainty factor we can use the following equation: where: cf1 is the confidence in hypothesis H established by Rule 1; cf2 is the confidence in hypothesis H established by Rule 2; |cf1| and |cf2| are absolute magnitudes of cf1 and cf2, respectively. 16
  • 17.
    Example 1 Consider theprevious rules: Rule 1: IF A is X THEN C is Z {cf 0.8} Rule 2: IF B is Y THEN C is Z {cf 0.6} if we assume that 𝑐𝑓 𝐸1 = 𝑐𝑓 𝐸2 = 1 17
  • 18.
    Consider the previousrules: 𝑐𝑓1 𝐻, 𝐸1 = 𝑐𝑓 𝐸1 × 𝑐𝑓 = 1.0 × 0.8 = 0.8 𝑐𝑓2 𝐻, 𝐸2 = 𝑐𝑓 𝐸2 × 𝑐𝑓 = 1.0 × 0.6 = 0.6 From the equation we obtain 𝑐𝑓 𝑐𝑓1, 𝑐𝑓2 = 𝑐𝑓1 𝐻, 𝐸1 + 𝑐𝑓2 𝐻, 𝐸2 − [1 − 𝑐𝑓1 𝐻, 𝐸1 ] = 0.92 18
  • 19.
    Again Consider theprevious rules: Rule 1: IF A is X THEN C is Z {cf 0.8} Rule 2: IF B is Y THEN C is Z {cf 0.6} Now, if we assume that 𝑐𝑓 𝐸1 = 1, 𝑐𝑓 𝐸2 = −1 19
  • 20.
    Consider the previousrules: 𝑐𝑓1 𝐻, 𝐸1 = 𝑐𝑓 𝐸1 × 𝑐𝑓 = 1.0 × 0.8 = 0.8 𝑐𝑓2 𝐻, 𝐸2 = 𝑐𝑓 𝐸2 × 𝑐𝑓 = −1.0 × 0.6 = −0.6 From the equation we obtain 𝑐𝑓 𝑐𝑓1, 𝑐𝑓2 = 𝑐𝑓1 𝐻, 𝐸1 + 𝑐𝑓2 𝐻, 𝐸2 1 − min[ 𝑐𝑓1 𝐻, 𝐸1 , 𝑐𝑓1 𝐻, 𝐸1 ] = 0.5 The combined certainty factor now drop because one evidence confirms a hypothesis but another discounts it. 20
  • 21.
    Example 2 • Wehave the following rules R1: if a and b then x (cf = 0.5) R2: if c or d then x (cf = 0.7) • We have the following Input: a, with certainty 1.0 b, with certainty 0.8 c, with certainty 0.9 d, with certainty 0.7 Then, Compute CF values for x: 21
  • 22.
    • CF(a andb) = MIN{1.0, 0.8} = 0.8 ==> CF1(x) = 0.8 * 0.5 = 0.4 • CF(c or d) = MAX{0.9, 0.7} = 0.9 ==> CF2(x) = 0.9 * 0.7 = 0.63 • CF(CF1, CF2) = 0.4 + 0.63 - 0.4*0.63 = 0.778 22
  • 23.
    Example 3 • Supposewe have the following rule R1: if (P1 and P2 and P3) or (P4 and not P5 then C1 (0.7) and C2 (-0.5) • Given the certainty factors of P1, P2, P3, P4, P5 are as follows: CF(P1) = 0.8, CF(P2) = 0.7, CF(P3) = 0.6, CF(P4) = 0.9, CF(P5) = -0.5, • What are the certainty factors associated with conclusions C1 and C2 after using rule R1? 23
  • 24.
    • Solution: For P1and P2 and P3, the CF is min(CF(P1), CF(P2), CF(P3)) = min(0.8, 0.7, 0.6) = 0.6. Call this CFA. For not P5, the CF is -CF(P5) = 0.5. For P4 and not P5, the CF is min(0.9, 0.5) = 0.5. Call this CFB. For (P1 and P2 and P3) or (P4 and not P5), the CF is: max(CFA, CFB) = max(0.6, 0.5) = 0.6. Thus CF(C1) = 0.7 * 0.6 = 0.42 CF(C2) = -0.5 * 0.6 = -0.30 24