0% found this document useful (0 votes)
9 views28 pages

Week11 Uncertainty Expert Systems

Uploaded by

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

Week11 Uncertainty Expert Systems

Uploaded by

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

Kingdom of Saudi Arabia

‫المملكة العربية السعودية‬


Ministry of Higher Education
‫وزارة التعليم العالي‬
Taibah University
‫جامعة طيبة‬
College of Computer Science and
‫كلية علوم و هندسة الحاسبات‬
Engineering

MSCS822 – Expert Systems and


Knowledge
Engineering Applications

Lectures of Week 11:


Uncertainty in Expert Systems
Introduction to Uncertainty
• The information available to humans is often
imperfect. An expert can cope with defects.

Classical logic permits only exact reasoning.

•IF A is true THEN A is ¬ false


and
•IF B is false THEN B is ¬true

• Most real-world problems do not provide exact


• information. It can be inexact, incomplete or even
• immeasurable.
Definition of Uncertainty
• Uncertainty is defined as the lack of the exact
knowledge, that would enable us to reach a perfectly
reliable conclusion.

•Classicallogic permits only exact reasoning. It assumes


that perfect knowledge always exists and the law of the
excluded middle can always be applied.

¬TRUE = FALSE.
Sources of Uncertain Knowledge

• Weak implications:

• Domain experts and knowledge engineers must


establish concrete correlations between IF and
THEN parts of the rules.

• Therefore, expert systems need to have the ability to


handle vague associations, for example by accepting
the degree of correlations as numerical certainty
factors.
Sources of Uncertain Knowledge
•Imprecise Language: Our natural language is ambiguous and
imprecise. As a result, it can be difficult to express knowledge in
the precise IF-THEN form of production rules.

•Expert systems need quantified measures.

Unknown Data: When the data is incomplete or missing, the


only solution is to accept the value “unknown” and proceed
to an approximate reasoning with this value.

•Disagreement among experts: Weighting associated to


different expert opinions.
Examine the Uncertainty

1. Probabilistic Reasoning

2. Probability Theory Basics

3. Bayesian Reasoning

4. Certainty Factors
Basics of probability theory
When examining uncertainty, we adopt probability as a
model to predict future events.

And likewise for failures, q.

Now let A be some event and B be some other event. These


are not mutually exclusive. Then conditional probability that
event A will occur given that B has occurred is P(A l B).
Bayesian Rule
The probability of both A and B both occurring, denoted is the
joint probability.

and is commutative
This allows us to derive the famous Bayesian Rule.

• If A is conditionally dependent on n other mutually exclusive


(disjoint) events then:
Dependent Events that are mutually exclusive

• We shall now consider the case where A depends on two


mutually exclusive events, From Equation 5

• and substituting this into Bayesian Rule (Equation 4) gives

• Equation 6 is used in the management of uncertainty in


expert systems.
Reasoning in Expert Systems
• Armed with Equation 6, we shall try to manage uncertainty in
expert systems.
• Suppose rules in a knowledge base are represented as
follows:
• Uncertain rules

• IF H is true THEN E is true, with probability p

• if event E has occurred, then probability of occurrence of H


can be obtained by Equation 6, replacing for A and B.
In this case, H is the hypothesis and E is the evidence. Rewriting
Eq. 6 in terms of H and E:
Generalising to m hypotheses and n
evidences (Generalized Bayesian Rule)
• Single evidence E and m hypotheses imply:

• Suppose the expert, given multiple (n) evidences, cannot


distinguish between m hypotheses:

• An application of Eq. 9 requires us to obtain the conditional


probabilities of all possible combinations of evidences for all
hypotheses! This grows exponentially.

• Therefore, assume conditional independence if possible.


Probabilistic reasoning in expert systems

• Let the posterior probability of hypothesis Hi upon


observing evidences E1… En be:

• This is a far more tractable solution and assumes


conditional independence among different evidences.
• Users provide information about the evidence observed and the
expert system computes p(H | E) for hypothesis H in the light of
the user-supplied evidence E.
• Probability p(H | E) is called the posterior probability of
hypothesis H upon observing evidence E.
How does an expert system compute posterior
probabilities and rank hypotheses?
• Example
p H i E3  p E3 Hi  p H i = 1, 2,
3 ,
3
 p E3 H k p
H k k 1
Thus, p H E 0.6   0.40
1 3 0.6  0.40 + 0.7  0.35 + 0.9   0.34
0.25
p H2 E3 0.7  0.35  0.34
0.6  0.40 + 0.7  0.35 + 0.9 
0.25
p H3 E3 0.9  0.25  0.32
0.6  0.40 + 0.7  0.35 + 0.9  0.25
After evidence E3 is observed, belief in hypothesis H1
decreases and becomes equal to belief in hypothesis H2.
Belief in hypothesis H3 increases and even nearly reaches
beliefs in hypotheses H1 and H2.
Suppose now that we observe evidence E1. The posterior
probabilities are calculated as:

p E1 H i  p E 3 H i  p H i , i = 1, 2,
p H i E1E3  3
3
 p E1 H k  p E3 H k  p H k

p H1 E1E3  0.3 * 0.6 * 0.40  0.19


0.2
0.3 0.6 0.40+ 0.80.70.35 + 0.5 5
p H 2 E1E3  0.80.7 0.35  0.52 0.2
0.3 0.60.40+ 0.80.7 0.35+ 0.5  5
p H 3 E1 E3
0.5 0.6 0.40+ 0.8 0.7 0.35 + 0.5  0.2
0.30.90.25
  0.29
5
Hypothesis H2 has now become the most likely one.
After observing evidence E2, the final posterior
probabilities for all hypotheses are calculated:

p E1 H i  p E 2 H i  p E 3 H i  p H i
p H i E1 E2 E3  3 , i = 1, 2,
3
 p E1 H k  p E2 H k  p E3 H k
 p H k k1
p H 1 E 1 E 2 E 3 0.3 0.9 0.6 0.40
 0.3 0.9 0.6 0.40+ 0.8
0.450.0 0.7 0.35+ 0.5 0.7 0.9
0.25
p H 2 E1E2E3  0.8 0.0 0.7 0.35 
0 0.0 0.7 0.35+ 0 . 5  0 . 7  0.9
0.3 0.9 0.6 0.40 + 0.8
0.25
p H 3 E1E2E3 0.5 0.7 0.9 0.25
 
0.3 0.9 0.6 0.40+ 0.80.55
0.0 0.7 0.35+ 0.5 0.7  0.9 0.25

Although the initial ranking was H1, H2 and H3, only


hypotheses H1 and H3 remain under consideration after
all evidences (E1, E2 and E3) were observed.
Bias of the Bayesian Method
• Bayesian reasoning requires probability inputs
requiring human judgement.

• Humans do not elicit probabilities completely


accurately.
• Conditional probabilities may be inconsistent with
prior probabilities given by the expert.

• The expert makes different assumptions and can


make inaccurate judgements.
Certainty factors theory and
evidential reasoning

 Certainty factors theory is a popular alternative to


Bayesian reasoning.

 A certainty factor (cf), a number to measure the


expert’s belief. The maximum value of the certainty
factor is, say, +1.0 (definitely true) and the minimum
-1.0 (definitely false).

For example, if the expert states that some evidence is


almost certainly true, a cf value of 0.8 would be
assigned to this evidence.
Uncertain terms and their
interpretation in MYCIN
Term
Certainty Factor
Definitely not _ 1.0
Almost certainly _ 0.8
not Probably not _ 0.6
Maybe not _ 0.4
Unknown _ 0.2 to +0.2
Maybe +0.4
Probably +0.6
Almost +0.8
certainly +1.0
Definitel
 In expert systems with certainty factors, the
knowledge base consists of a set of rules
that have the following syntax:

IF <evidence>
THEN <hypothesis> {cf}

where cf represents belief in hypothesis H


given that evidence E has occurred.
The certainty factors theory is based on two functions:
measure of belief MB(H,E), and measure of disbelief
MD(H,E).
 1
 if p( H) = 1

MB (H, E) =  max p(H E), p ( H )   p( H) otherwise


 max 1, 0  p( H)

 1 if p( H) = 0

MD (H, E) =  min  p(H E), p(H)   p(H) otherwise


 min 1, 0  p(H)
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.
 The values of MB(H, E) and MD(H, E) range
between 0 and 1. The strength of belief or disbelief in
hypothesis H depends on the kind of evidence E
observed. Some facts may increase the strength of
belief, but some increase the strength of disbelief.

The total strength of belief or disbelief in a

hypothesis:

MB H,E  MD H,E
cf =
 Example 1:
Consider a simple rule:
IF A is X
THEN B is Y

An expert may not be that this rule holds. Also


suppose it is absolutely certain as been observed that
in some cases, even when the IF part of the rule is
satisfied and object A takes on value X, object B can
acquire some different value Z.
IF A is X
THEN B is Y {cf 0.7};
B is Z {cf 0.2}
 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

Example of CF establishing net certainity:

IF sky is clear
THEN the forecast is sunny {cf 0.8}
and 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 “Forecast may be sunny”.
 CLIPS Example of establishing net
certainity
(defrule rule-with-CFs
"this is a rule with a cf associated with it"
(declare (CF 0.8)) ; rule has a CF of 0.8
(person-age ?name ?age&:(> ?age 50))
=>
(assert (person-weightClass ?name over-weight)) )
 CLIPS Example of CF (contd..)

The rule says that if we find a person over 50 years of


age then we can expect that that person will be
overweight.

The certainty factor for the rule says that we have only
80% confidence that this rule is correct.

Therefore the asserted fact that the person is


overweight will be assigned a certainty of 0.8.
 CLIPS Example of CF (contd..)
However, if the fact had been asserted like:

(assert (person-age Ahmed 55) CF 0.9)

This says that we are certain of Ahmed's age with a 0.9


CF. In this case the fact would have been asserted as:

(person-weightClass Ahmed over-weight) CF 0.72

Since we were only 0.8 certain of our rule and 0.9


certain of the age then we are 0.9 * 0.8 = 0.72 certain of
the weight class for the person.
Certainty factors theory
• The certainty factors theory provides a practical
alternative to Bayesian reasoning.

• The heuristic manner of combining certainty factors is


different from the manner in which they would be
combined if they were probabilities.

• The certainty factors theory is not “mathematically


pure” but does mimic the thinking process of a human
expert.

You might also like