0% found this document useful (0 votes)
32 views

21csc206t Unit 5

Unit 5 covers planning and learning in artificial intelligence, detailing planning problems, simple planning agents, and various planning languages. It introduces the Blocks World problem, goal stack planning, means-ends analysis, and non-linear planning techniques. Additionally, it discusses machine learning concepts, models, and various learning methodologies such as reinforcement and adaptive learning.

Uploaded by

subuprasanna2004
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)
32 views

21csc206t Unit 5

Unit 5 covers planning and learning in artificial intelligence, detailing planning problems, simple planning agents, and various planning languages. It introduces the Blocks World problem, goal stack planning, means-ends analysis, and non-linear planning techniques. Additionally, it discusses machine learning concepts, models, and various learning methodologies such as reinforcement and adaptive learning.

Uploaded by

subuprasanna2004
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/ 174

UNIT – 5

UNIT V
• Planning – planning problem – Simple planning agent – Blocks world
problem – Mean Ends analysis
• Learning - Machine learning - Learning concepts, methods and models
• Introduction to expert system – architecture of expert systems.
Planning and Learning
Table of Contents
• Planning- Planning problems, Simple planning agent, Planning languages
Planning
• Find a sequence of actions that achieves a given goal when executed from a given
initial world state.
That is, given
• a set of operator descriptions (defining the possible primitive actions by the agent),
• an initial state description, and
• a goal state description or predicate,
• compute a plan, which is a sequence of operator instances, such that executing them
in the initial state will change the world to a state satisfying the goal-state
description.
• Goals are usually specified as a conjunction of subgoals to be achieved
Planning vs. Problem Solving
• Planning and problem solving methods can often solve the same sorts of
problems
• Planning is more powerful because of the representations and methods used.
• States, goals, and actions are decomposed into sets of sentences (usually in
first-order logic)
• Search often proceeds through plan space rather than state space (though
there are also state-space planners)
• Subgoals can be planned independently, reducing the complexity of the
planning problem
Planning Problem

Get tea, biscuits, and a book.

Given:

•Initial state:
•Initial state: The agent is at home without tea, biscuits, book

•‹ Goal state: Goal state: The agent is at home with tea, biscuits, book biscuits,
book
Planning Problem

States can be represented by predicates


At(x), Have(y), Sells(x, y)
„ Actions:
‹ Go(y) : Agent goes to y
– causes At(y) to be true

‹ Buy(z): Agent buys z


– causes Have(z) to be true

‹ Steal(z): Agent steals z


Planning Problem

▪Actions are given as logical descriptions of preconditions and effects.


▪ This enables the planner to make direct connections between states and
actions. connections between states and actions.

▪The planner is free to add actions to the plan wherever they are required,
rather than wherever they are required, rather than in an incremental way
starting from the initial state. incremental way starting from the initial state.

▪„Most parts of the world are independent of most other parts – hence divide
& conquer works well.
Situation Calculus
Initial state:
At(Home, s0) ∧ ¬ Have(Tea, s0) ∧ ¬ Have(Biscuits, s0) ∧ ¬Have(Book, s0)
Goal state:
∃ s At(Home, s) ∧ Have(Tea, s) ∧ Have(Biscuits, s) ∧ Have(Book, s)

Operators:
∀ a,s Have(Tea, Result(a,s)) ⇔ [(a = Buy(Tea) ∧ At(Tea-shop,s))
∨ (Have(Tea, s) ∧ a ≠ Drop(Tea))]

Result(a,s) names the situation resulting from executing the action a in the
situation s
Simple Planning Agent

Use percepts to build model of current world state


IDEAL-PLANNER: Given a goal, algorithm generates plan of action
STATE-DESCRIPTION: given percept, return initial state description in format required by
planner
MAKE-GOAL-QUERY: used to ask KB what next goal should be
A Simple Planning Agent
Planning Languages
To represent planning problems we use Artificial Intelligence planning languages that
describe environment’s conditions which then lead to desired goals by generating chain of
actions based on these conditions.

STRIPS (STanford Research Institute Problem Solver) -an action language which was a part
of the first major planning system with the same name.

ADL (Action Description Language) is one of STRIPS extension which supports negative
literals, quantified variables in goals (e.g. ∃x At (P1, x) ∧ At(P2, x)), conditional effects and
disjunctions in goals (all not allowed in STRIPS)

PDDL (Planning Domain Definition Language). - an attempt to standardize planning


languages (STRIPS, ADL and much more other representational languages)
Planning and Learning
Table of Contents
• Planning- Planning problems, Simple planning agent, Planning languages
• Blocks world ,Goal stack planning, Mean Ends Analysis
• Non-linear Planning, Conditional planning, Reactive planning
• Learning- Machine learning, Goals and Challenges of machine learning
• Learning concepts, models, Artificial neural network based learning- Back
propagation, Support vector machines,
• Reinforcement learning, Adaptive learning, Multi_agent based learning, Ensemble
learning, Learning for decision making, Distributed learning, Speedup learning
Blocks World Problem(Planning)

What is the Blocks World? -- The world consists of:


•A flat surface such as a tabletop
•An adequate set of identical blocks which are identified by letters.
•The blocks can be stacked one on one to form towers of apparently unlimited height.
•The stacking is achieved using a robot arm which has fundamental operations and states
which can be assessed using logic and combined using logical operations.
•The robot can hold one block at a time and only one block can be moved at a time.
Blocks World Problem(Planning)

We shall use the four actions:


UNSTACK(A,B)-- pick up clear block A from block B;
STACK(A,B)-- place block A using the arm onto clear block B;
PICKUP(A)-- lift clear block A with the empty arm;
PUTDOWN(A)-- place the held block A onto a free space on the table.

and the five predicates:


ON(A,B)-- block A is on block B.
ONTABLE(A)-- block A is on the table.
CLEAR(A)-- block A has nothing on it.
HOLDING(A)-- the arm holds block A.
HANDEMPTY-- the arm holds nothing
The Planning System Strips
⮚initial state Init (given by predicate logical formulae)
⮚goal state goal (given by predicate logical formulae)
⮚set of rules (given by name, preconditions, delete list, & add list )

Initial State Goal State


The Planning System Strips
The Planning System Strips
Goal Stack Planning
GOAL STACK PROBLEM

Problem solver relies on


• A database that describes the current situation.
• Set of operators with precondition, add and delete lists.
Let us assume that the goal to be satisfied is:

GOAL = G1 ^ G2 ^ … ^Gn
Sub-goals G1, G2, … Gn are stacked with compound goal G1 ^ G2 ^ …^ Gn at the
bottom.

Top G1
G2
:

Gn
Bottom G1 ^ G2 ^ … ^ G4
At each step of problem solving process, the top goal on the stack is pursued.
GOAL STACK PROBLEM- The Idea!
:Place goal in goal stack
Goal1
,Considering top Goal1
place onto it its sub-
:goals GoalS1-2
GoalS1-1
Goal1

Then try to solve sub-goal


…GoalS1-2, and continue
GOAL STACK PROBLEM - ALGORITHM

Algorithm

1. Find an operator that satisfies sub goal G1 (makes it true) and replace G1
by the operator.
2. If more than one operator satisfies the sub goal then apply some
heuristic to choose one.
3. In order to execute the top most operation, its preconditions are added
onto the stack.
4. Once preconditions of an operator are satisfied, then we are guaranteed
that operator can be applied to produce a new state.
5. New state is obtained by using ADD and DELETE lists of an operator to
the existing database.
6. Problem solver keeps tract of operators applied.
7. This process is continued till the goal stack is empty and problem solver
returns the plan of the problem.
GOAL STACK PROBLEM- Complete
v
solution

(UNSTACK(C,D),PUTDOWN(C),UNSTACK(D,A),STACK(D,B)
,PICKUP(A),STACK(A,D))
GOAL STACK PROBLEM-
Example
The Working!
Initial state Goal state
A
C C
A B B

Place on stack original .1


:goal
Stack: On(A,C) & On(C,B)

:Database CLEAR(B)
ON(C,A)
CLEAR(C)
ONTABLE(A)
ONTABLE(B)
HANDEMPTY
GOAL STACK PROBLEM-
The Working!
2. Since top goal is unsatisfied compound
goal, list its unsatisfied subgoals on top of it:

On(C,B)

:Stack On(A,C)

On(A,C) & On(C,B)

CLEAR(B)
ON(C,A)
Database CLEAR(C)
ONTABLE(A)
:)unchanged( ONTABLE(B)
HANDEMPTY
GOAL STACK PROBLEM-
The Working!
3. Since top goal is unsatisfied single-literal goal, find rule whose
instantiated add-list includes the goal, and: a. Replace the goal with
the instantiated rule; b. Place the rule’s instantiated precondition
formula on top of stack

Holding(C) & Clear(B)


:Stack stack(C,B)
stack(C,B) On(C,B)
On(A,C)
On(A,C) & On(C,B)

CLEAR(B)
Database ON(C,A)
:)unchanged( CLEAR(C)
ONTABLE(A)
ONTABLE(B)
HANDEMPTY
GOAL STACK PROBLEM-
The Working!
4. Since top goal is unsatisfied compound goal, list its subgoals on top
of it:
Clear(B)
Holding(C)
:Stack
Holding(C) & Clear(B)
stack(C,B)
stack(C,B)
On(A,C)

On(A,C) & On(C,B)

CLEAR(B)
Database ON(C,A)
:)unchanged( CLEAR(C)
ONTABLE(A)
ONTABLE(B)
HANDEMPTY
GOAL STACK PROBLEM-
The Working!
5. Single goal on top of stack matches data base, so remove it:
Clear(B)
Holding(C)
:Stack
Holding(C) & Clear(B)
stack(C,B)
stack(C,B)
On(A,C)

On(A,C) & On(C,B)

CLEAR(B)
Database ON(C,A)
:)unchanged( CLEAR(C)
ONTABLE(A)
ONTABLE(B)
HANDEMPTY
GOAL STACK PROBLEM-
The Working!
6. Since top goal is unsatisfied single-literal goal, find rule whose
instantiated add-list includes the goal, and: a. Replace the goal with
the instantiated rule; b. Place the rule’s instantiated precondition
formula on top of stack

On(C,A) &Clear(C) & Handempty


unstack(C,A)
unstack(C,A) Holding(C)
Holding(C) & Clear(B)
stack(C,B)
stack(C,B)
:Stack On(A,C)

On(A,C) &On(C,B)

Database: (unchanged)
GOAL STACK PROBLEM-
The Working!
7. Compound goal on top of stack matches data base, so remove it:

On(C,A) &Clear(C) & Handempty


unstack(C,A)
unstack(C,A)
:Stack
Holding(C) & Clear(B)
stack(C,B)
stack(C,B)
On(A,C)

On(A,C) &On(C,B)

CLEAR(B)
Database ON(C,A)
:)unchanged( CLEAR(C)
ONTABLE(A)
ONTABLE(B)
HANDEMPTY
!STEPS CONTINUES UNTIL STACK IS EMPTY
Means - Ends Analysis
• Search strategies either reason forward of backward
• Mixed strategy - solve the major parts of problem first and solve
the smaller problems the arise when combining them together.
• Such a technique is called "Means - Ends Analysis".
• The means -ends analysis process centers around finding the
difference between current state and goal state.
• The problem space of means - ends analysis has
– an initial state and one or more goal state,
– a set of operate with a set of preconditions their application
and
– difference functions computes the difference between two
state a(i) and s(j).
Problem Solving using
Means - Ends Analysis
The algorithm for MEA consists of the following steps:
Step 1: Measure the current state of things by doing as is the study and
capture the status at a macro level and to a possible micro level.
Step 2: Capture the deficiency in the current state and avenues for
improvements (wish list) and define the goal state (to-be state).
Define the to-be state at a macro level and to a possible micro level.
Step 3: Compare the Current state and Goal state and if they are at the
same level the problem is resolved.
Step 4: List the differences between the current state and goal state at
macro and micro levels.
Step 5: Convert the differences into deletions/modifications to current
state and new additions.
Step 6: Define the action to implement the changes as defined in step-
5.
Step 7: Implement the changes and measure the actual results with
the planned goals.
Step 8: Do course correction and achieve the final goal.
Problem Solving using
Means - Ends Analysis - Example
Example 1:
• If in your current state you are hungry, and in your goal state you are not
hungry
• Preconditions of visit_cafeteria: you know where the cafeteria is.
Postconditions of visit_cafeteria: you are no longer hungry.
Example 2:
MEA – To do Exercise!

Example:
An electronics business company aims to get a turnover of Rs. 10 crores
per annum. How do you do?
Planning and Learning
Table of Contents
• Planning- Planning problems, Simple planning agent, Planning languages
• Blocks world ,Goal stack planning, Mean Ends Analysis
• Non-linear Planning, Conditional planning, Reactive planning
• Learning- Machine learning, Goals and Challenges of machine learning
• Learning concepts, models, Artificial neural network based learning- Back
propagation, Support vector machines,
• Reinforcement learning, Adaptive learning, Multi_agent based learning, Ensemble
learning, Learning for decision making, Distributed learning, Speedup learning
Planning and Learning
Partial-order planning

A linear planner builds a plan as a totally ordered sequence of plan steps

A non-linear planner (aka partial-order planner) builds up a plan as a set of


steps with some temporal constraints
- constraints of the form S1 < S2 if step S1 must comes before S2.

One refines a partially ordered plan (POP) by either:


⮚adding a new plan step , or
⮚adding a new constraint to the steps already in the plan.

A POP can be linearized (converted to a totally ordered plan) by topological


sorting
Least commitment
•Non-linear planners embody the principle of least commitment
- only choose actions, orderings, and variable bindings that are
absolutely necessary, leaving other decisions till later
- avoids early commitment to decisions that don’t really matter

•A linear planner always chooses to add a plan step in a particular place in


the sequence

•A non-linear planner chooses to add a step and possibly some temporal


constraints
Non-linear plan
A non-linear plan consists of
(1) A set of steps {S1, S2, S3, S4 …}
Each step has an operator description, preconditions and post-conditions
(2) A set of causal links { … (Si, C, Sj) …}
Meaning a purpose of step Si is to achieve precondition C of step Sj
(3) A set of ordering constraints { … Si < Sj … }
if step Si must come before step Sj

A non-linear plan is complete iff


- Every step mentioned in (2) and (3) is in (1)
- If Sj has prerequisite C, then there exists a causal link in (2) of the form (S i, C, Sj)
for some Si
- If (Si, C, Sj ) is in (2) and step Sk is in (1), and Sk threatens (Si, C, Sj) (makes C false),
The initial plan
Solution
Conditional Planning
•The agent might not know what the initial state is
• The agent might not know the outcome of its actions
•The plans will have branches rather than being straight line plans,
includes conditional steps
if < test > then plan A else plan B
•Full observability: The agent knows what state it currently is, does not
have to execute an observation action Simply get plans ready for all
possible contingencies
•Actions sometimes fail → disjunctive effects
•Example: moving left sometimes fails
Action (Left, PRECOND: AtR, EFFECT: AtL ∨ AtR )
Conditional Planning
•Conditional effects: effects are conditioned on secondary preconditions
Action (Suck, PRECOND: ;,
EFFECT: (when AtL: CleanL ) ∧ (when AtR: CleanR))

Actions may have both disjunctive and conditional effects: Moving


sometimes dumps dirt on the destination square only when that square
is clean

Action (Left, PRECOND: AtR;, EFFECT: AtL ∨ (AtL ∧ when CleanL:


¬ CleanL))
Example : The vacuum world
Conditional Planning
Partially observable environments
The agent knows only a certain amount of the actual state (e.g., local
sensing only, does not know about the other squares)
Automatic sensing: at every time step the agent gets all the
available percepts

Active sensing: percepts are obtained only by executing specific


sensory actions

Belief state: The set of possible states that the agent can be in
“Alternate double Murphy world”: dirt can sometimes be left
behind when the agent leaves a clean square
Example –Part of the Search
Reactive planning
•Reactive planning is planning under uncertainty.
•A group of techniques for action selection by autonomous agents.
• Differs from classical planning in two aspects:
➤ operate in a timely fashion and hence can cope with highly dynamic
and unpredictable environments.
➤ compute just one next action in every instant, based on the current
context.
•Reactive planners often (but not always) exploit reactive plans, which are stored
structures describing the agent's priorities and behaviour.
•Makes use of the if-then rules.
•The rule which is at present in execution is said to be active whereas the others
are inactive.
21-04-2021 18CSC305J_AI_UNIT3 47
REACTIVE PLAN REPRESENTATION

➤ Finite State Machines (FSMs) and Behavior trees

➤ Fuzzy approaches (Utility Systems)

➤ Connectionists approaches

21-04-2021 18CSC305J_AI_UNIT3 48
Reactive Plan – If then, Conflict Resolution
1. If A Then B & C
2. If B Then E
3. If C Then A
4. If B& C Then E
5. If E Then G

1, 4, 2,3,5

21-04-2021 18CSC305J_AI_UNIT3 49
REACTIVE PLAN REPRESENTATION
➤ Finite State Machines (FSMs) and Behavior trees

21-04-2021 18CSC305J_AI_UNIT3 50
REACTIVE PLAN REPRESENTATION
➤ Fuzzy approaches (Utility Systems)

21-04-2021 18CSC305J_AI_UNIT3 51
REACTIVE PLAN REPRESENTATION
Connectionists approaches

21-04-2021 18CSC305J_AI_UNIT3 52
Planning and Learning
Table of Contents
• Planning- Planning problems, Simple planning agent, Planning languages
• Blocks world ,Goal stack planning, Mean Ends Analysis
• Non-linear Planning, Conditional planning, Reactive planning
• Learning- Machine learning, Goals and Challenges of machine learning
• Learning concepts, models, Artificial neural network based learning- Back
propagation, Support vector machines
• Reinforcement learning, Adaptive learning, Multi_agent based learning, Ensemble
learning, Learning for decision making, Distributed learning, Speedup learning
Learning
An agent is learning if it improves its performance on future tasks after
making observations about the world.

Any component of an agent can be improved by learning from data.

The improvements, and the techniques used to make them, depend on four major
factors:
• Which component is to be improved.
• What prior knowledge the agent already has.
• What representation is used for the data and the component.
• What feedback is available to learn from.
Machine Learning Defined
The oft quoted and widely accepted formal definition of machine learning as stated
by field pioneer Tom M. Mitchell is:
A computer program is said to learn from experience E with respect to some
class of tasks T and performance measure P if its performance at tasks in T, as
measured by P, improves with experience E

Another Definition of Machine learning :


Machine learning is a subfield of computer science, but is often also referred
to as predictive analytics, or predictive modeling. Its goal and usage is to build new
and/or leverage existing algorithms to learn from data, in order to build
generalizable models that give accurate predictions, or to find patterns, particularly
with new and unseen similar data.
DL ML AI
Goals of Machine Learning
The goal of ML, in simples words, is to understand the nature of (human and
other forms of) learning, and to build learning capability in computers.
To be more specific, there are three aspects of the goals of ML.
(1) To make the computers smarter, more intelligent. The more direct objective
in this aspect is to develop systems (programs) for specific practical learning
tasks in application domains.
(2) To develop computational models of human learning process and perform
computer simulations. The study in this aspect is also called cognitive
modeling.
(3) To explore new learning methods and develop general learning algorithms
independent of applications.
Challenges of Machine Learning
In Machine Learning, we can hope to discover ways for machine to learn which are better
than ways human learn (the opportunity), and that there are amply amount of difficulties
to be overcome in order to make machines learn (the challenge).
Learning…
• UnSupervised Learning
• Supervised Learning
• Reinforcement Learning
Planning and Learning
Table of Contents
• Planning- Planning problems, Simple planning agent, Planning languages
• Blocks world ,Goal stack planning, Mean Ends Analysis
• Non-linear Planning, Conditional planning, Reactive planning
• Learning- Machine learning, Goals and Challenges of machine learning
• Learning concepts, models, Artificial neural network based learning- Back
propagation, Support vector machines
• Reinforcement learning, Adaptive learning, Multi_agent based learning, Ensemble
learning, Learning for decision making, Distributed learning, Speedup learning

21-04-2021 18CSC305J_AI_UNIT4 60
Learning concepts

• Supervised Learning - Involves learning a function that maps an input to an output


based on example input-output pairs
• Unsupervised Learning - The machine learns from data for which the outcomes are
not known. It’s given input samples, but no output samples
• Semi-Supervised Learning -A model uses unlabeled data to gain a general sense of
the data’s structure, then uses a small amount of labeled data to learn how to group
and organize the data as a whole. Sometimes referred to as “weak learning.”
• Reinforcement Learning – Allows the machine or agent to learn its behaviour
based on feedback from the environment
21-04-2021 18CSC305J_AI_UNIT4 61
Supervised Learning

If shape of object is rounded If shape of object is rounded If shape of object is long


and depression at top having and depression at top having curving cylinder having color
color Red then it will be color Green then it will be Green-Yellow then it will be
labelled as –Apple. labelled as –Green Apple. labelled as –Banana.
62
Supervised Learning Contd…

Supervised learning

Classification Regression

A classification problem is when A regression problem is when


the output variable is a category, the output variable is a real
such as “Red” or “blue” or value, such as “dollars” or
“disease” and “no disease”. “weight”. 63
CLASSIFICATION

Which of the following are classification tasks?


• Find the gender of a person by analyzing his writing style
• Predict the price of a house based on floor area, number of
rooms etc.
• Predict whether there will be abnormally heavy rainfall next
year
• Predict the number of copies of a book that will be sold this
month
64
CLASSIFICATION

Which of the following are classification tasks?


• Find the gender of a person by analyzing his writing style
• Predict the price of a house based on floor area, number of
rooms etc.
• Predict whether there will be abnormally heavy rainfall next year
• Predict the number of copies of a book that will be sold this
month

65
REGRESSION

Which ONE of the following are regression tasks?


• Predict the age of a person
• Predict the country from where the person comes from
• Predict whether the price of petroleum will increase tomorrow
• Predict whether a document is related to science

66
REGRESSION

Which ONE of the following are regression tasks?


• Predict the age of a person
• Predict the country from where the person comes from
• Predict whether the price of petroleum will increase tomorrow
• Predict whether a document is related to science

67
Un-Supervised Learning

68
Un -Supervised Learning

Which of the following are examples of unsupervised learning?


• Group news articles based on text similarity
• Make clusters of books on similar topics in a library
• Filter out spam emails
• Segment online customers into two classes based on their age group – below
25 or above 25

69
Un -Supervised Learning

Which of the following are examples of unsupervised learning?


• Group news articles based on text similarity
• Make clusters of books on similar topics in a library
• Filter out spam emails
• Segment online customers into two classes based on their age group – below
25 or above 25

70
Semi Supervised Learning

71
Reinforcement Learning

The idea behind Reinforcement Learning is that an agent will learn from the environment by
interacting with it and receiving rewards for performing actions.

That’s how humans learn, through interaction. Reinforcement Learning is just a


computational approach of learning from action.
72
CATEGORICAL VS CONTINOUS

CATEGORICAL:
• Finite number of categories of
classes
• Gender, age group, Presence or
absence of something

CONTINOUS:
• Infinite number of values
• Age, height, weight, price

73
Introduction to simple linear regression

• Relation between variables where changes in some variables may “explain” or


possibly “cause” changes in other variables.
• Explanatory variables are termed the independent variables and the variables to be
explained are termed the dependent variables.
• Regression model estimates the nature of the relationship between the independent
and dependent variables.
• Change in dependent variables that results from changes in independent variables,
• ie. size of the relationship.
• Strength of the relationship.
• Statistical significance of the relationship.

74
Examples

Dependent Independent
variables variables
Retail price of petrol in
The price of crude oil.
Chennai

Hours of work, education,


occupation, sex, age, region,
Employment income
years of experience,
unionization status, etc

Quantity of product sold Price


75
Bivariate and multivariate models
Bivariate or simple regression model

(Education) x y y (Income)

(Education) x1

(Gender) x2
y (Income)

(Experience) x3

(Age) xModel
4
with simultaneous relationship
Price of wheat Quantity of wheat produced
76
Bivariate or simple linear regression

x is the independent variable


y is the dependent variable
The model has two variables,
• the independent or explanatory variable, x, and
• the dependent variable y, the variable whose variation is
to be explained.
• The relationship between x and y is a linear or straight
line relationship.

Two parameters to estimate –


the slope of the line β1 and
the y-intercept β0 (where the line crosses the vertical
axis).
77
ε is the unexplained, random, or error component. Much more
Uses of regression

• Amount of change in a dependent variable that results from changes in the independent
variable(s) – can be used to estimate elasticities, returns on investment in human capital,
etc.
• Attempt to determine causes of phenomena.

• Prediction and forecasting of sales, economic growth, etc.

• Support or negate theoretical model.

• Modify and improve theoretical models and explanations of phenomena.

78
Classification Techniques
What is Classification?
It is a process of categorizing a given set
of feature vectors into two or more classes.

Classification Techniques:
• Logistic Regression
• Artificial Neural Networks (ANN)
• Support Vector Machine (SVM)
• Deep Neural Network (DNN)
• Convolution Neural Network (1D-CNN and
2D-CNN)

79
Logistic Regression
•Logistic Regression is a Machine Learning classification algorithm that is used to predict
the probability of a categorical dependent variable.
• In logistic regression, the dependent variable is a binary variable that contains data coded
as 1 (yes, success, etc.) or 0 (no, failure, etc.). In other words, the logistic regression model
predicts P(Y=1) as a function of X.

Logistic regression is a supervised machine


learning algorithm that accomplishes binary
classification tasks by predicting the probability of
an outcome, event, or observation. The model
delivers a binary or dichotomous outcome limited
to two possible outcomes: yes/no, 0/1, or
true/false.
80
Types of Logistic Regression

1. Binary Logistic Regression: The categorical response has only two 2 possible
outcomes. E.g.: Spam or Not
2. Multinomial Logistic Regression: Three or more categories without ordering.
E.g.: Predicting which food is preferred more (Veg, Non-Veg, Vegan)
3. Ordinal Logistic Regression: Three or more categories with ordering. E.g.:
Movie rating from 1 to 5

81
Math behind Binary Logistic Regression

X1, x2, x3 = input value


y = predicted output
b0 = bias or intercept term
B1, b2, b3 = coefficient for input (x1, x2, x3)

This equation is similar to linear regression, where the input values


are combined linearly to predict an output value using weights or
coefficient values. However, unlike linear regression, the output value
modeled here is a binary value (0 or 1) rather than a numeric value.

Demo
82
Logistic Regression
Applications of classification

1. Determine the probability of heart attacks


2. Possibility of enrolling into a university
3. Identifying spam emails
4. Image classification.
5. Fraud detection.
6. Document classification.
7. Spam filtering.
8. Facial recognition.

Demo
9. Voice recognition.
10.Medical diagnostic test.
11.Customer behavior prediction. 84
Clustering Techniques
What is Clustering?
• It is a process of dividing the given set of feature vectors into two or more groups
(clusters). The data points in each cluster are somehow related to each other.
Applications of Clustering
• Recommendation engines
• Market segmentation
• Social network analysis
• Search result grouping
• Image segmentation

Clustering Techniques:
• k-means Clustering
• Hierarchical Clustering

85
K-means Clustering Algorithm
Start

Initialize k centroids (k
mean vectors)

Yes
Compute distance between each feature vector to all
the centroids
Is there any No
Assign each feature vector to any one of the Centroid change in End
based on minimum Euclidean distance Centroid?

Re-estimate the Centroids

86
K-means Clustering Algorithm
• K-Means clustering is an unsupervised iterative clustering technique.
• It partitions the given data set into k predefined distinct clusters.
• A cluster is defined as a collection of data points exhibiting certain
similarities.

87
K-means Clustering Algorithm
• It partitions the data set such that-
• Each data point belongs to a cluster with the nearest mean.
• Data points belonging to one cluster have high degree of similarity.
• Data points belonging to different clusters have high degree of dissimilarity.

88
Use K-Means Algorithm to create two clusters

C1
A 2 2 C1 1.5 1.166667
C1 1 1
E 1.5 0.5

C2
B 3 2 C2 3 1.5
D 3 1

Demo
89
Machine Learning Models
• Artificial neural networks

• Decision trees

• Support-vector machines

• Regression analysis

• Bayesian networks

• Genetic algorithms

21-04-2021 18CSC305J_AI_UNIT4 90
Artificial neural network based learning

• Artificial Neural Network ANN is an efficient computing system whose central theme is borrowed from the
analogy of biological neural networks.
• ANNs are also named as “artificial neural systems” acquires a large collection of units that are
interconnected in some pattern to allow communication between the units. These units, also referred to as
nodes or neurons, are simple processors which operate in parallel.
• Every neuron is connected with other neuron through a connection link. Each connection link is associated
with a weight that has information about the input signal. This is the most useful information for neurons to
solve a particular problem because the weight usually excites or inhibits the signal that is being
communicated.
• Each neuron has an internal state, which is called an activation signal. Output signals, which are produced
after combining the input signals and activation rule, may be sent to other units.

21-04-2021 18CSC305J_AI_UNIT4 91
Model of Artificial Neural Network

21-04-2021 18CSC305J_AI_UNIT4 92
Back Propagation Method
▪ Back propagation is a common method for training a neural network.
▪ It is the method of fine-tuning the weights of a neural net based on the error rate obtained
in the previous epoch (i.e., iteration).
▪ Proper tuning of the weights allows you to reduce error rates and to make the model
reliable by increasing its generalization
• TWO STEPS:
• Forward pass phase: computes ‘functional signal’, feed forward propagation of input
pattern signals through network
• Backward pass phase: computes ‘error signal’, propagates the error backwards through
network starting at output units (where the error is the difference between actual and
desired output values

21-04-2021 18CSC305J_AI_UNIT4 93
Back Propagation Algorithm

21-04-2021 18CSC305J_AI_UNIT4 94
Back Propagation Algorithm

21-04-2021 18CSC305J_AI_UNIT4 95
Back Propagation Algorithm
A neural network with two inputs, two hidden neurons, two output neurons. Additionally,
the hidden and output neurons will include a bias.
The initial weights, the biases, and training inputs/outputs are given as follows:

The goal of back propagation is to optimize the


weights so that the neural network can learn how
to correctly map arbitrary inputs to outputs.

we’re going to work with a single training set:


given inputs 0.05 and 0.10,
we want the neural network to output 0.01 and
0.99.(Expected / Desired)

22-04-2021 18CSC305J_AI_UNIT4 96
The Forward Pass
• First, we’ll feed the inputs 0.05 and 0.10 forward through the network.
• We figure out the total net input to each hidden layer neuron, squash the total net input
using an activation function (here we use the logistic function), then repeat the process with
the output layer neurons.

22-04-2021 18CSC305J_AI_UNIT4 97
The Forward Pass contd…

22-04-2021 18CSC305J_AI_UNIT4 98
The Forward Pass contd…

22-04-2021 18CSC305J_AI_UNIT4 99
The Backward Pass
Our goal with back propagation is to update each of the weights in the network so that they cause the
actual output to be closer the target output, thereby minimizing the error for each output neuron and the
network as a whole.

22-04-2021 18CSC305J_AI_UNIT4 100


The Backward Pass contd…

22-04-2021 18CSC305J_AI_UNIT4 101


The Backward Pass contd…

22-04-2021 18CSC305J_AI_UNIT4 102


The Backward Pass contd…

22-04-2021 18CSC305J_AI_UNIT4 103


The Backward Pass contd…

22-04-2021 18CSC305J_AI_UNIT4 104


The Backward Pass contd…

22-04-2021 18CSC305J_AI_UNIT4 105


The Backward Pass contd…

22-04-2021 18CSC305J_AI_UNIT4 106


Planning and Learning
Table of Contents
• Planning- Planning problems, Simple planning agent, Planning languages
• Blocks world ,Goal stack planning, Mean Ends Analysis
• Non-linear Planning, Conditional planning, Reactive planning
• Learning- Machine learning, Goals and Challenges of machine learning
• Learning concepts, models, Artificial neural network based learning- Back
propagation, Support vector machines
• Reinforcement learning, Adaptive learning, Multi_agent based learning, Ensemble
learning, Learning for decision making, Distributed learning, Speedup learning

22-04-2021 18CSC305J_AI_UNIT4 107


Support vector machines

• Support Vector Machines is considered to be a classification approach, it but


can be employed in both types of classification and regression problems.
• It can easily handle multiple continuous and categorical variables.
• SVM constructs a hyperplane in multidimensional space to separate different
classes.
• SVM generates optimal hyperplane in an iterative manner, which is used to
minimize an error.
• The core idea of SVM is to find a maximum marginal hyperplane(MMH)
that best divides the dataset into classes.

21-04-2021 18CSC305J_AI_UNIT4 108


Support vector machines
• Support Vectors - The data points, which are closest
to the hyperplane. These points will define the
separating line better by calculating margins.
These points are more relevant to the construction
of the classifier
• Hyperplane - A decision plane which separates
between a set of objects having different class
memberships.
• Margin - A margin is a gap between the two lines on the
closest class points. This is calculated as the perpendicular distance from the
line to support vectors or closest points. If the margin is larger in between the
classes, then it is considered a good margin, a smaller margin is a bad margin.
21-04-2021 18CSC305J_AI_UNIT4 109
How does SVM work?

21-04-2021 18CSC305J_AI_UNIT4 110


How does SVM work?

21-04-2021 18CSC305J_AI_UNIT4 111


How does SVM work?

21-04-2021 18CSC305J_AI_UNIT4 112


SVM Kernels
• The SVM algorithm is implemented in practice using a kernel. A kernel transforms an input data space into the required
form. SVM uses a technique called the kernel trick. Here, the kernel takes a low-dimensional input space and transforms
it into a higher dimensional space.(it converts non separable problem to separable problems by adding more dimension
to it) It is most useful in non-linear separation problem. Kernel trick helps us to build a more accurate classifier.
TYPES:
• Linear Kernel : A linear kernel can be used as normal dot product any two given observations. The product between
two vectors is the sum of the multiplication of each pair of input values. K(x, xi) = sum(x * xi)
• Polynomial Kernel A polynomial kernel is a more generalized form of the linear kernel. The polynomial kernel can
distinguish curved or nonlinear input space.
K(x,xi) = 1 + sum(x * xi)^d
Where d is the degree of the polynomial. d=1 is similar to the linear transformation. The degree needs to be manually
specified in the learning algorithm.

21-04-2021 18CSC305J_AI_UNIT4 113


SVM Kernels
• Radial Basis Function Kernel The Radial basis function kernel is a popular kernel
function commonly used in support vector machine classification. RBF can map an input
space in infinite dimensional space.

21-04-2021 18CSC305J_AI_UNIT4 114


SVM -Linear Example

21-04-2021 18CSC305J_AI_UNIT4 115


SVM -Linear Example

21-04-2021 18CSC305J_AI_UNIT4 116


SVM -Linear Example

21-04-2021 18CSC305J_AI_UNIT4 117


SVM -Linear Example

21-04-2021 18CSC305J_AI_UNIT4 118


SVM -Linear Example

21-04-2021 18CSC305J_AI_UNIT4 119


SVM -Linear Example

21-04-2021 18CSC305J_AI_UNIT4 120


SVM -Linear Example

21-04-2021 18CSC305J_AI_UNIT4 121


SVM -Linear Example

21-04-2021 18CSC305J_AI_UNIT4 122


Planning and Learning
Table of Contents
• Planning- Planning problems, Simple planning agent, Planning languages
• Blocks world ,Goal stack planning, Mean Ends Analysis
• Non-linear Planning, Conditional planning, Reactive planning
• Learning- Machine learning, Goals and Challenges of machine learning
• Learning concepts, models, Artificial neural network based learning- Back
propagation, Support vector machines,
• Reinforcement learning, Adaptive learning, Multi_agent based learning, Ensemble
learning, Learning for decision making, Distributed learning, Speedup learning

21-04-2021 18CSC305J_AI_UNIT4 123


Reinforcement Learning
• Reinforcement Learning is a feedback-based Machine learning technique in which an
agent learns to behave in an environment by performing the actions and seeing the
results of actions. For each good action, the agent gets positive feedback, and for each
bad action, the agent gets negative feedback or penalty.
• In Reinforcement Learning, the agent learns automatically using feedbacks without any
labeled data, unlike supervised learning.
• Since there is no labeled data, so the agent is bound to learn by its experience only.
• RL solves a specific type of problem where decision making is sequential, and the goal is
long-term, such as game-playing, robotics, etc.
• The agent interacts with the environment and explores it by itself. The primary goal of an
agent in reinforcement learning is to improve the performance by getting the maximum
positive rewards.

21-04-2021 18CSC305J_AI_UNIT4 124


Reinforcement Learning Example
Q- Learning

Reward values:
• Idling is -1. We don't want the mouse to wander.
• Collecting a cheese is +100.
• The cat hits the mouse -100.
• The mouse hits the walls -100. We don't want to see the
Catch the Cheese Game
• AI agent (mouse) itself learns to run away from the mouse trying to go out of the game field.
cat and collect cheeses in the game.

• At the beginning, the mouse knows nothing about how


to play properly the game and interacts with the
environment randomly.
• The mouse receives rewards or punishments on each
its action. This makes the mouse understand which
actions were good and which weren't at particular game
situations (states).
• Therefore, the mouse tries to maximize its rewards and
avoid punishments during training.
Reinforcement Learning Example
agents must continually make value judgements so as to select good
Q- Learning actions over bad. This knowledge is represented by a Q-network that
estimates the total reward that an agent can expect to receive after taking
a particular action.

Two years ago we introduced the first widely successful algorithm for deep
reinforcement learning. The key idea was to use deep neural networks to
represent the Q-network, and to train this Q-network to predict total
reward.

Previous attempts to combine RL with neural networks had largely failed


due to unstable learning. To address these instabilities, our Deep Q-
Networks (DQN) algorithm stores all of the agent's experiences and then
randomly samples and replays these experiences to provide diverse and
decorrelated training data.

We applied DQN to learn to play games on the Atari 2600 console. At each
time-step the agent observes the raw pixels on the screen, a reward signal
corresponding to the game score, and selects a joystick direction.

Google DeepMind created an artificial intelligence program using deep


reinforcement learning that plays Atari games and improves itself to a
superhuman level. It is capable of playing many Atari games and uses a
combination of deep artificial neural networks and reinforcement learning.
After presenting their initial results with the algorithm, Google almost
Google DeepMind's Deep Q-learning playing immediately acquired the company for several hundred million dollars,
Atari Breakout! hence the name Google DeepMind.
https://www.youtube.com/watch?v=V1eYniJ0Rnk
Reinforcement Learning Example
Q- Learning
Q-learning is a machine learning approach that
enables a model to iteratively learn and improve
over time by taking the correct action. Q-learning is
a type of reinforcement learning.
With reinforcement learning, a machine learning
model is trained to mimic the way animals or
children learn. Good actions are rewarded or
reinforced, while bad actions are discouraged and
penalized.

The agent -- which is the AI component that acts in


the environment -- iteratively learns and makes
predictions about the environment on its own.
Reinforcement Learning Example Q- Learning
Components of Q-learning include the following:
• Agents. The agent is the entity that acts and operates within an environment.
• States. The state is a variable that identifies the current position in an environment of an agent.
• Actions. The action is the agent's operation when it is in a specific state.
• Rewards. A foundational concept within reinforcement learning is the concept of providing either a
positive or a negative response for the agent's actions.
• Episodes. An episode is when an agent can no longer take a new action and ends up terminating.
• Q-values. The Q-value is the metric used to measure an action at a particular state.
Two methods to determine the Q-value:
• Temporal difference. The temporal difference formula calculates the Q-value by incorporating the
value of the current state and action by comparing the differences with the previous state and action.
• Bellman's equation. Mathematician Richard Bellman invented this equation in 1957 as a recursive
formula for optimal decision-making. In the q-learning context, Bellman's equation is used to help
calculate the value of a given state and assess its relative position. The state with the highest value is
considered the optimal state.
Reinforcement Learning Example
Q- Learning
Q(s1, a12) = r(s1,a12) + 0.5 (Max (s2, a21), (s2,a23), (s2, a25)
Q(s2, a23) = r(s2,a23) + 0.5 (Max (s3,a36), (s3,a32));
Q(s3, a36) = r(s3, a36) = 100
-----------------------------------------------------
Q(s3, a36) = r(s3, a36) = 100
Q(s2, a23) = r(s2,a23) + 0.5 (Max (s3,a36), (s3,a32));
Q(s2, a23)= 0 + 0.5(Max (100, 0)) = 50
Q(s1, a12) = r(s1,a12) + 0.5 (Max (s2, a21), (s2,a23),
(s2, a25)
Q(s1, a12) = 0 + 0.5(Max (0, 50, 0)) = 25.

Demystifying AI algorithms
Reinforcement Learning Example
Q- Learning
Q(s1, a12) = r(s1,a12) + 0.5 (Max (s2, a21), (s2,a23), (s2, a25))
Q(s2, a25) = r(s2,a25) + 0.5 (Max (s5,a52), (s5,a54), (s5, a56));
Q(s5, a52) = r(s5, a52) + 0.5(Max(s2, a21), (s2,a23), (s2,a25))
Q(s2, a23) = r(s2,a23) + 0.5 (Max (s3,a36), (s3,a32));
Q(s3, a36) = r(s3, a36) = 100
-----------------------------------------------------
Q(s3, a36) = r(s3, a36) = 100
Q(s2, a23) = r(s2,a23) + 0.5 (Max (s3,a36), (s3,a32));
Q(s2, a23) = 0 + 0.5( Max (100,0)) = 50
Q(s5, a52) = r(s5, a52) + 0.5(Max(s2, a21), (s2,a23), Q(s2, a25) = r(s2,a25) + 0.5 (Max
(s2,a25)) (s5,a52), (s5,a54), (s5, a56));
Q(s5, a52) = 0 + 0.5(Max (50,0)) = 25 Q(s2, a25) = 0 + 0.5( Max(25, 0,0)) = 12.5;
Q(s1, a12) = r(s1,a12) + 0.5 (Max (s2, a21),
(s2,a23), (s2, a25))
Q(s1, a12) = 0 + 0.5(Max (0, 0,12.5)) = 6.25

Demystifying AI algorithms
Reinforcement Learning Algorithm

21-04-2021 18CSC305J_AI_UNIT4 131


Positive Reinforcement

• The positive reinforcement learning means adding something to increase the


tendency that expected behavior would occur again. It impacts positively on
the behavior of the agent and increases the strength of the behavior.

• This type of reinforcement can sustain the changes for a long time, but too
much positive reinforcement may lead to an overload of states that can
reduce the consequences.

21-04-2021 18CSC305J_AI_UNIT4 132


Negative Reinforcement

• The negative reinforcement learning is opposite to the positive reinforcement


as it increases the tendency that the specific behavior will occur again by
avoiding the negative condition.

• It can be more effective than the positive reinforcement depending on


situation and behavior, but it provides reinforcement only to meet minimum
behavior.

21-04-2021 18CSC305J_AI_UNIT4 133


Reinforcement Learning Vs Supervised
Learning

21-04-2021 18CSC305J_AI_UNIT4 134


Reinforcement Learning

• Reinforcement Learning is a feedback-based Machine learning technique in which an


agent learns to behave in an environment by performing the actions and seeing the results
of actions. For each good action, the agent gets positive feedback, and for each bad action,
the agent gets negative feedback or penalty.
• In Reinforcement Learning, the agent learns automatically using feedbacks without any
labeled data, unlike supervised learning.
• Since there is no labeled data, so the agent is bound to learn by its experience only.
• RL solves a specific type of problem where decision making is sequential, and the goal is
long-term, such as game-playing, robotics, etc.
• The agent interacts with the environment and explores it by itself. The primary goal of an
agent in reinforcement learning is to improve the performance by getting the maximum
positive rewards.
21-04-2021 18CSC305J_AI_UNIT4 135
Expert Systems
Expert Systems - Objectives

• Learn the meaning of an expert system


• Understand the problem domain and knowledge domain
• Learn the advantages of an expert system
• Understand the stages in the development of an expert
system
• Examine the general characteristics of an expert system
Objectives

• Examine earlier expert systems which have given rise to


today’s knowledge-based systems
• Explore the applications of expert systems in use today
• Examine the structure of a rule-based expert system
• Learn the difference between procedural and
nonprocedural paradigms
• What are the characteristics of artificial neural systems
What is an expert system?
“An expert system is a computer system that emulates, or acts in all
respects, with the decision-making capabilities of a human expert.”

Professor Edward Feigenbaum


Stanford University
Architecture of Expert Systems
Architecture of Expert Systems

Knowledge Base
Stores all relevant information, data, rules, cases, and
relationships used by the expert system.
Uses
•Rules
•If-then Statements
•Fuzzy Logic

Inference Engine
Seeks information and relationships from the knowledge
base and provides answers, predictions, and suggestions
the way a human expert would.
Uses
•Backward Chaining
•Forward Chaining
Architecture of Expert Systems

Explanation Facility
Allows a user to understand how the expert system arrived at certain conclusions or results.
For example: it allows a doctor to find out the logic or rationale of the diagnosis made by a medical expert
system

Knowledge acquisition facility


Provide convenient and efficient means of capturing and storing all the components of the knowledge base.
Acts as an interface between experts and the knowledge base.

User Interface
Specialized user interface software employed for designing, creating, updating, and using expert
systems.
The main purpose of the user interface is to make the development and use of an expert system easier
for users and decision makers
General Methods of Inferencing
• Forward chaining (data-driven)– reasoning from facts to the conclusions
resulting from those facts – best for prognosis, monitoring, and control.
– Examples: CLIPS, OPS5

• Backward chaining (query/Goal driven)– reasoning in reverse from a


hypothesis, a potential conclusion to be proved to the facts that support the
hypothesis – best for diagnosis problems.
– Examples: MYCIN
General Methods of Inferencing
General Methods of Inferencing
Expert Systems Development
Expert system technology may include:

• Special expert system languages – CLIPS

• Programs

• Hardware designed to facilitate the implementation of those


systems
Problem Domain vs. Knowledge Domain

• An expert’s knowledge is specific to


one problem domain – medicine,
finance, science, engineering, etc.
• The expert’s knowledge about
solving specific problems is called
the knowledge domain.
• The problem domain is always a
superset of the knowledge domain.
Advantages of Expert Systems
Disadvantages of Expert Systems
Representing the Knowledge

The knowledge of an expert system can be represented


in a number of ways, including IF- THEN rules:

IF you are hungry THEN eat


Knowledge Engineering

The process of building an expert system:

1. The knowledge engineer establishes a


dialog with the human expert to elicit
knowledge.
2. The knowledge engineer codes the
knowledge explicitly in the knowledge
base.
3. The expert evaluates the expert system
and gives a critique to the knowledge
engineer.
The Role of AI

• An algorithm is an ideal solution guaranteed to yield a solution in


a finite amount of time.
• When an algorithm is not available or is insufficient, we rely on
artificial intelligence (AI).
• Expert system relies on inference – we accept a “reasonable
solution.”
Uncertainty

• Both human experts and expert systems must be able to deal with
uncertainty.
• It is easier to program expert systems with shallow knowledge
than with deep knowledge.
• Shallow knowledge – based on empirical and heuristic
knowledge.
• Deep knowledge – based on basic structure, function, and
behavior of objects.
Early Expert Systems

• DENDRAL – used in chemical mass spectroscopy to identify


chemical constituents
• MYCIN – medical diagnosis of illness

• DIPMETER – geological data analysis for oil

• PROSPECTOR – geological data analysis for minerals

• XCON/R1 – configuring computer systems


Broad Classes of Expert Systems
Considerations for Building Expert Systems

• Can the problem be solved effectively by conventional


programming?
• Is there a need and a desire for an expert system?
• Is there at least one human expert who is willing to cooperate?
• Can the expert explain the knowledge to the knowledge
engineer can understand it.
• Is the problem-solving knowledge mainly heuristic and
uncertain?
Building Expert Systems
Languages, Shells, and Tools

• Expert system languages are post-third generation.


• Procedural languages (e.g., C) focus on techniques to
represent data.
• More modern languages (e.g., Java) focus on data abstraction.
• Expert system languages (e.g. CLIPS) focus on ways to represent
knowledge.
EXPERT SYSTEM
CASE STUDY
MYCIN
MYCIN
•MYCIN was an early expert system that used artificial intelligence to identify
bacteria causing severe infections.
• Recommend antibiotics, with the dosage adjusted for patient's body weight
•The MYCIN system was also used for the diagnosis of blood clotting diseases.
• MYCIN was developed over five or six years in the early 1970s at Stanford
University.
•It was written in Lisp
MYCIN
MYCIN

•MYCIN was a stand alone system that required a user to enter all relevant
information about a patient by typing in responses to questions MYCIN posed.
•MYCIN operated using a fairly simple inference engine, and a knowledge base of
~600 rules.
•It would query the physician running the program via along series of simple yes/no
or textual questions.
Tasks and Domain
•Disease DIAGNOSIS and Therapy SELECTION

•Advice for non-expert physicians with time considerations and

incomplete evidence on:

–Bacterial infections of the blood

–Expanded to meningitis and other ailments

–Meet time constraints of the medical field


Consultation System
Consultation “Control Structure”

•Goal-directed Backward-chaining Depth-first Tree Search


•High-level Algorithm:
1.Determine if Patient has significant infection
2.Determine likely identity of significant organisms
3.Decide which drugs are potentially useful
4.Select best drug or coverage of drugs
Static Database
Dynamic Database
Explanation System
CASE STUDY
Xcon
Xcon
•The R1 (internally called XCON, for eXpertCONfigurer) program was a production rule based system written
in OPS5 by John P. McDermott of CMU in 1978.
–configuration of DEC VAX computer systems
•ordering of DEC's VAX computer systems by automatically selecting the computer system components based
on the customer's requirements.
•XCON first went into use in 1980 in DEC's plant in Salem, New Hampshire. It eventually had about 2500 rules.
•By 1986, it had processed 80,000 orders, and achieved 9598% accuracy.
•It was estimated to be saving DEC $25M a year by reducing the need to give customers free components
when technicians made errors, by speeding the assembly process, and by increasing customer satisfaction.
•XCON interacted with the sales person, asking critical questions before printing out a coherent and workable
system specification/order slip.
•XCON's success led DEC to rewrite XCON as XSEL a version of XCON intended for use by DEC's salesforce to
aid a customer in properly configuring their VAX.
XCON: Architecture

The problem description of XCON - which is part of


the knowledge to be examined - is a list of
components.

XCON is an atypical example as it uses rules


to establish a global flow of control.

Using XCON DEC was able to eliminate FA & T and


to reduce average shipping time

• Production-rule-based system written in OPS5


• XSEL is used interactively to assist in the
selection of saleable parts which make up a
customer order
• XFL is used to diagram a computer room floor
layout for the configuration(s) under
consideration. Provides “minimum footprint” floor
layout of components.
• XCLUSTER is used to assist in configuring
clusters.
XCON: Architecture
• R1/XCON is the expert system for configuring DEC computers.

• Given a customer's purchase order, XCON determines substitutions and additions to make the order
consistent and produces a number of diagrams showing the spatial and logical relationships among the
components.

• The decisions to be made concern component types and properties, placement of components into boxes
and cabinets, electrical connections among components, etc.

• XCON is a very large rule-based system. It currently contains more than 6200 rules which draw on a
database of approximately 20,000 parts. Furthermore, each year about half of the rules are expected to
change.

• XCON is used to configure customer orders and to guide the assembly of these orders at the customer site.
Using the customer order as input, it provides the following functionality:
• Configures CPUs, memory, cabinets, power supplies, disk, tapes and so on.
• Determines and list cabling information.
• List components ordered with configuration related comments.
• Generate warning messages on issues affecting technical validity.
XCON: Expert Configurer

XCON is used to validate the technical correctness (configurability) of customer


orders and to guide the actual assembly of these orders. It provides the
following functionality: * Configures CPUS, memory, boxes, backplanes,
cabinets, and power supplies, disks, tapes, HSC/CI, printers, etc.
Thank You

You might also like