CS 3 - Problem Solving Agent
CS 3 - Problem Solving Agent
CS 2-Agents &Environment
BITS Pilani Dr. Vijayalakshmi Anand
Pilani Campus
Course Plan
M1 Introduction to AI
M2 Problem Solving Agent using Search
M3 Game Playing, Constraint Satisfaction Problem
M4 Knowledge Representation using Logics
M5 Probabilistic Representation and Reasoning
M6 Reasoning over time, Reinforcement Learning
B. Intelligent Agents
C. Task Environment
An AI system is composed of
an agent
an environment
Example of agents
Robotic
Human
Software
Simple
No calculation or solve complicated problems
Fully observable environment
Works on condition-action rule
Poker Chess
Sensor Based:
Observability : Full Vs Partial
Action Based:
Dependency : Episodic Vs Sequential
State Based:
No.of.State : Discrete Vs Continuous
Agent Based:
> Cardinality : Single Vs MultiAgent
Supervised learning
Unsupervised learning
Reinforcement learning
Test
Set
Training
Learn
Set Classifier Model
Classification: Application 1
Direct Marketing
– Goal: Reduce cost of mailing by targeting a set of consumers likely to buy a new cell-
phone product.
– Application:
Retail industry-by providing useful and accurate trends.
Credit company –to identify customers to be interested
– Approach:
• Use the data for a similar product introduced before.
• We know which customers decided to buy and which decided
otherwise. This {buy, don’t buy} decision forms the class attribute.
• Collect various demographic, lifestyle, and company-interaction
related information about all such customers.
– Type of business, where they stay, how much they earn, etc.
• Use this information as input attributes
Fromto learn
[Berry a classifier
& Linoff] Data model.
Mining Techniques, 1997
Fraud Detection
– Goal: Predict fraudulent cases in credit card transactions.
– Approach:
• Use credit card transactions and the information on
its account-holder as attributes.
– When does a customer buy, what does he buy, how often
he pays on time, etc
• Label past transactions as fraud or fair
transactions. This forms the class attribute.
• Learn a model for the class of the transactions.
• Use this model to detect fraud by observing credit
card transactions on an account.
Customer Attrition/Churn:
– Goal: To predict whether a customer is likely to be lost to a competitor.
– Approach:
• Use detailed record of transactions with each of
the past and present customers, to find attributes.
– How often the customer calls, where he calls, what time-
of-the day he calls most, his financial status, marital
status, etc.
• Label the customers as loyal or disloyal.
• Find a model for loyalty.
From [Berry & Linoff] Data Mining Techniques, 1997
Similarity Measures:
– Euclidean Distance if attributes are continuous.
– Other Problem-specific Measures.
Market Segmentation:
– Goal: subdivide a market into distinct subsets of customers where any subset may
conceivably be selected as a market target to be reached with a distinct marketing
mix.
– Approach:
• Collect different attributes of customers based on their
geographical and lifestyle related information.
• Find clusters of similar customers.
• Measure the clustering quality by observing buying
patterns of customers in same cluster vs. those from
different clusters.
Document Clustering:
– Goal: To find groups of documents that are similar to
each other based on the important terms appearing in
them.
– Approach: To identify frequently occurring terms in
each document. Form a similarity measure based on
the frequencies of different terms. Use it to cluster.
– Gain: Information Retrieval can utilize the clusters to
relate a new document or search term to clustered
documents.
example
Basic diagram for reinforcement learning
algorithm
1 - https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2747434/
2 – Early diagnosis saves lives, cuts treatment costs
Buzz Words
– Expert’s Knowledge
– Representation
– Solving problems
Knowledge Representation
– Expert Knowledge is represented in Symbols
that can be understood by programs
– Representation schemes: Predicate Logic,
Frames and associative networks, Fuzzy
Logic, Object oriented methods
Knowledge Representation
– E.g.,
• “Spot is a dog” is an English sentence
• If represented in logic, “dog(Spot)”
• Suppose, we have a logic representation of
fact that “all dogs have tails”
Example 1:
User’s Input - (father bob sam) (mother sue sam)
Match step: r5 and r6 rules are matched and their conclusions
(husband bob sue) and (wife sue bob) are put in a conflict set
Select step: Simply select the first match, i.e., (husband bob
sue)
Execute step: Trigger a message to user and probe further
questions and repeat
Forward Chaining: The input is matched from LHS and the RHS
is executed
Example 2:
Suppose, we added (a6 (father sam bill)) and (a7 (father
bill pam)) to knowledge base
User Input: Who is the grandfather of Pam? (grandather
?x pam)
Match step: (r7 ((father ?x ?y) (father ?y ?z)
(grandfather ?x pam))
– (father ?x ?y) (father ?y pam)
– Substituting with a7 (father ?x bill) (father bill pam)
– Substituting with a6 (father sam bill) (father bill pam)
– (grandfather sam pam)
How Query?
– How did you reach this conclusion?
– The sequence of rules that led to the
conclusion are displayed to the user
– E.g., Why is Sam the grandfather of Pam?
• Pam’s father is Bill and Bill’s father is Sam.
As per Rule no. 7, it infers that Sam is the
grandfather of Pam.
A. Uninformed Search
B. Informed Search
C. Heuristic Functions
“a problem- Goal
Formulatio
solving refers to n
a state where we
Problem
wish to reach to Formulatio
n
a definite goal
from a present Search
state or condition Phase
Execution
Phase BITS Pilani, Pilani Campus
Problem Solving Agents-Goal
formulation
first and simplest step in problem-solving.
organizes the steps/sequence required to formulate
one goal out of multiple goals as well as actions to
achieve that goal.
current situation and the agent’s performance measure
is the first step in problem solving.
Leaf Nodes
(no children yet)
Nodes
States
Frontier | Fringes
Search Strategy : LIFO | FIFO | Priority Queue
Performance Metrics
Completeness
Optimality
Time Complexity
Space Complexity
Algorithm Terminology
- d Depth of a node - m – maximum
- b Branching factor - C* - Optimal Cost
- n – nodes - E – least Cost
- l – level of a node - N –total node generated
(1)
Complete – If the shallowest goal node is at a depth d, BFS will eventually find it by
generating all shallower nodes
Optimal – Not necessarily. Optimal if path cost is equal
Time Complexity – b - branching factor, d – depth
Space Complexity –