AI Lecture 12-b
AI Lecture 12-b
INTELLIGENCE
DR. MANAL TANTAWI
ASSOCIATE PROFESSOR
IN
SCIENTIFIC COMPUTING DEPARTMENT
FACULTY OF COMPUTER & INFORMATION
SCIENCES
AIN SHAMS UNIVERSITY
PART 12-B
➢Revision
• REGARDING A DATASET OF FIVE EXAMPLES. EACH EXAMPLE IS REPRESENTED BY
TWO FEATURES (X1, X2) AS FOLLOWS :
A1 A2 A3 Decision
F F F NO
F F T YES
F T F YES
F T T YES
T F F NO
T F T YES
T T F NO
• LOG SHOULD BE BASE 2
• 4 YES 3 NO TOTAL 7
ENTROPY (4+, 3-) = -4/7 LOG (4/7) – 3/7 LOG 3/7 =0.9851
FOR A3 => 0.9851 – 3/7 * 0 – 4/7 [ - ¾ LOG ¾ - ¼ LOG ¼ ]=
0.9851 – 0 – 0.4634 = 0.5221
FOR A2 => 0.9851- 4/7 (1) – 3/7 [ -2/3 LOG2/3 - 1/3 LOG 1/3] =
0.9851 – 0.5714 – 0.393 =0.0206
FOR A1 => 0.9851 – 4/7 [ - ¾ LOG ¾ - ¼ LOG ¼ ] -3/7 [ -2/3 LOG2/3 - 1/3 LOG 1/3]=
0.9851 - 0.463 - 0.393 = 0.1291
THE WINNER IS A3
• TOTAL 4 1 YES 3 NO
• ENTROPY (1+, 3-) =[-1/4 LOG ¼ - 3/4LOG ¾] =0.811
FOR A1 => 0.811 – 2/4 (0) – 2/4 (1) = 0.311
FOR A2 => 0.811 – 2/4 (1) – 2/4 (0) = 0.311
WE CAN TAKE A1 OR A2
LET’S TAKE A1
T F
T F
2) If an input is added to the training set with missing value for A3 as follows
A1 A2 A3 Decision
T T ? YES
Suggest a value T or F for A3 and show why you choose this value.
5 20 30 40 45 50 55
No No Yes Yes Yes Yes No
Average for decision changing cases (20 + 30)/2 =25 (50 +55) /2 = 52.5
For A4>25 => 0.9851- 2/7 (0) – 5/7 [ -4/5 log 4/5 – 1/5 log 1/5]= 0.469
For A4 > 52.5 => 0.9851- 1/7 (0) – 6/7 [ -4/6 log 4/6 – 2/6 log 2/6]= 0.198
The optimum value of d is 25 (better information gain)
THE FOLLOWING TABLE CONTAINS DATA ABOUT ANIMALS IF THEY ARE MAMMALS OR
NOT AND THE CORRESPONDING FULL DECISION TREE IS GIVEN. APPLY THE POST-
PRUNING ALGORITHM TO SHOW IF THE TREE IS OPTIMUM OR NOT
( LET LAMBDA = 0.03)
• COST FUNCTION = 0 + 0.03 (4) =0.12
Mammals
Regarding a dataset of seven examples. Each example is represented by two features (A, B)
as follows:
Consider applying K means algorithm to know the optimum position for the center of two clusters C1 and C2,
show the calculations for the first iteration.
COMPLETE THE FOLLOWING SENTENCES:
1) ………………… provides the necessary information, facts, while …………. is the ability to learn, reason,
and adapt, using knowledge to perform tasks and solve complex problems.
2) “ sky is clear” is example for ………………… knowledge.
3) ………………. is knowing when to use a specific algorithm based on the problem at hand.
4) ……………… is a popular programming language that utilizes propositional and predicate logic to
represent knowledge.
5) Regarding knowledge representation approaches, ……………………representation are data structures
that encapsulate knowledge about objects, situations, or events in a structured format. On the other hand,
……………….. represent knowledge in the form of graphical networks.
6) ……………....... express knowledge in the form of conditions and corresponding actions. They are a key
component of rule-based systems.
7) The ………….. is known as the brain of the expert system as it is the main processing unit of the system.
8) …………… based expert systems don’t learn and can easily suffer from overfitting.
9) ……………… means low train error and high-test error.
10) ……………… data set used to avoid overfitting. The inference engine is known as the brain of the
expert system as it is the main processing unit of the system.
COMPLETE THE FOLLOWING SENTENCES:
1. Knowledge provides the necessary information, facts, while intelligence is the ability to learn, reason, and
adapt, using knowledge to perform tasks and solve complex problems.
2. “ sky is clear” is example for declarative knowledge.
3. Meta knowledge is knowing when to use a specific algorithm based on the problem at hand.
4. Prolog is a popular programming language that utilizes propositional and predicate logic to represent
knowledge.
5. Regarding knowledge representation approaches, Frames representation are data structures that
encapsulate knowledge about objects, situations, or events in a structured format. On the other hand,
semantic networks represent knowledge in the form of graphical networks.
6. Production rules express knowledge in the form of conditions and corresponding actions. They are a key
component of rule-based systems.
7. The inference engine is known as the brain of the expert system as it is the main processing unit of the
system.
8. rules based expert systems don’t learn and can easily suffer from overfitting.
9. overfitting means low train error and high-test error.
10. validation data set used to avoid overfitting.
COMPLETE THE FOLLOWING SENTENCES:
11) ………….. is partially observable environment, while ………………. Is fully observable environment.
12) If the next state of the environment is completely determined by the current state and the action executed
by the agent, then we say the environment is …………..; otherwise, it is …………..
COMPLETE THE FOLLOWING SENTENCES:
11) Taxi driving is partially observable environment, while crossword puzzle Is fully observable environment.
12) If the next state of the environment is completely determined by the current state and the action executed
by the agent, then we say the environment is deterministic; otherwise, it is stochastic.
CHOOSE THE CORRECT ANSWER
1) Video games are example for ……….. Agent
a) Simple reflex
b) Utility based
c) Goal based
d) Hierarchical based
2) …………. agent recommends songs based on how likely you are to click on it.
a) Simple reflex
b) Utility based
c) Goal based
d) Hierarchical based
3) ……………….. Is fully observable environment, single agent, deterministic, sequential, static, and discrete.
a) Poker
b) Crossword puzzle
c) Backgammon
d) Chess
CHOOSE THE CORRECT ANSWER
1) Video games are example for ……….. Agent
a) Simple reflex
b) Utility based
c) Goal based
d) Hierarchical based
2) …………. agent recommends songs based on how likely you are to click on it.
a) Simple reflex
b) Utility based
c) Goal based
d) Hierarchical based
3) ……………….. Is fully observable environment, single agent, deterministic, sequential, static, and discrete.
a) Poker
b) Crossword puzzle
c) Backgammon
d) Chess
THANK YOU