You are on page 1of 19

Artificial Intelligence

Artificial Intelligence

Contents
- Reasoning and Knowledge Representation
- Knowledge Representation
- Reasoning
- Knowledge representation via Decision tree
- Propositional Logic
- First order logic
Knowledge representation

Is the study of – how knowledge and facts about the world


can be represented.
Knowledge representation and
reasoning

Knowledge representation and reasoning is the field of


artificial intelligence (AI) dedicated to represent information
about the world in a form that a computer system can
understand at the first place and then utilize to solve complex
tasks such as diagnosing a medical condition.

Knowledge representation incorporates findings from


psychology about how humans solve problems and represent
knowledge in order to design formalisms that will make
complex systems easier to design and build
Knowledge representation and
reasoning

Examples of knowledge representation include systems


architecture, rules.

Knowledge representation is not just storing data into


some database, but it also enables an intelligent
machine to learn from that knowledge and experiences
so that it can behave intelligently like a human.
Representing Knowledge as Decision
Trees
Decision tree is the most widely used & practical learning
method.

The learning is supervised: i.e. the classes or categories of


the data instances are known.

The target function can be Boolean or discrete valued


Decision Tree Representation
1. Each node corresponds to an attribute

2. Each branch corresponds to an attribute value

3. Each leaf node assigns a classification.

1
2

3
Decision Tree Representation

Building decision tree algo:


-Choose a most fruitful attribute to split the decision tree, choice of
attribute in data splitting is very important .
-The node is said to be pure when all fall in the specific category.
-Impurity of nodes is calculated by the entropy of data in the note.
-Entropy- is the amount of data randomness or uncertainty.

Entropy = p(A)log(P(A)) – p(B)log(P(B))

A- sertraline (Zoloft)
B- fluvoxamine (Luvox)
Decision Tree Representation
Decision Tree Representation
Decision Tree Representation

For simplicity we focus on the binary classification setting, namely,


Y={0,1}, but decision trees can be applied for other prediction problems
as well.
At each node on the root-to-leaf path, the successor child is chosen.
Decision Tree Representation

Each path from the tree root to a leaf corresponds to a


combination of attribute tests (one rule for classification).

A popular splitting rule at internal nodes (tree root to tree leaf)


is based on thresholding the value of a single feature.
Logics
Many knowledge representation systems rely on some
variant of logic, e.g.:
–Propositional logic
–First order logic
–Temporal logic•

Logic defines:
–Syntax: describes how sentences are formed in
the language (proper arrangement of words in their
places)
–Semantics: describes the meaning of sentences,
what is it the sentence refers to in the real world.
Logics
1-Proposition logic is the Simplest type of logic•
A proposition is a statement that is either true or false

• Examples:
- It is raining today.
- Food is tasty.

• More complex sentences:


-It is raining outside and the traffic in Islamabad is heavy.

It is raining out side traffic in Islamabad is heavy


Logics
2-First order logic is more complex and objects, relations,
properties are explicit

•Examples:
-Blue (car12) car12 is blue
-loves (Umer, salah) umer loves salah
- ?? Umer eats either apple or banana.
Logics
First order logic is more complex and objects, relations, properties
are explicit

•simple Examples:
-Blue (car12) car12 is blue
-loves (Umer, salah) umer loves salah
-eats( Umer, apple) V eats(Umer, banana) Umer eats either apple or banana.
Logics
First order logic is more complex and objects, relations, properties
are explicit

•simple Examples:
-Blue (car12) car12 is blue
-loves (Umer, salah) umer loves salah
-eats( Umer, apple) V eats(Umer, banana) Umer eats either apple or banana.
•More complex sentences:

1- Universal Quantifier
Ɐx(student(x) cricket(x)) all students like cricket

ⱻx(student(x) ^ cricket(x)) some students like cricket


Jazak Allah khair

You might also like