Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation...

90
Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS

Transcript of Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation...

Page 1: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

Lectures 5,6

MACHINE LEARNING

EXPERT SYSTEMS

Page 2: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

Contents

Machine learning Knowledge representation Expert systems

Page 3: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

INDUCTION OF DECISION TREES FROM DATA

Page 4: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

Sunny Rain

Overcast

Outlook

Humidity Wind

High Normal Strong Weak

Outlook Temp. Humid. Wind Sport?

1 Sunny Hot High Weak No

2 Sunny Hot High Strong No

3 Overcast Hot High Weak Yes

4 Rain Mild High Weak Yes

5 Rain Cold Normal Weak Yes

6 Rain Cold Normal Strong No

7 Overcast Cold Normal Strong Yes

8 Sunny Mild High Weak No

9 Sunny Cold Normal Weak Yes

10 Rain Mild Normal Weak Yes

11 Sunny Mild Normal Strong Yes

12 Overcast Mild High Strong Yes

13 Overcast Hot Normal Weak Yes

14 Rain Mild High Strong No

Decision trees

Sport=No Sport=Yes

Page 5: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

Data from credit history of loan applications

Page 6: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.
Page 7: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

A simplified tree… But how to do it?

Page 8: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

The induction algorithm ID3

Page 9: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

Partially constructed decision trees

STEP 1

STEP 2

Page 10: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

A heuristic problem

HOW TO SELECT THE BEST PROPERTY?

Page 11: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

Approximate trees

High Normal

Humidity

85%Outlook

75%100%

Sunny Not Sunny

Outlook Temp. Humid. Wind Sport?

1 Sunny Hot High Weak No

2 Sunny Hot High Strong No

3 Overcast Hot High Weak Yes

4 Rain Mild High Weak Yes

5 Rain Cold Normal Weak Yes

6 Rain Cold Normal Strong No

7 Overcast Cold Normal Strong Yes

8 Sunny Mild High Weak No

9 Sunny Cold Normal Weak Yes

10 Rain Mild Normal Weak Yes

11 Sunny Mild Normal Strong Yes

12 Overcast Mild High Strong Yes

13 Overcast Hot Normal Weak Yes

14 Rain Mild High Strong No

Page 12: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

CLASSIFICATION SYSTEMS

Page 13: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

A full classification system

Page 14: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

Pattern recognition

Patterns:– images, personal records, driving habits, etc.

Representation:– vector of features (inputs to a neural network)

Pattern classification: – Classify a pattern to one of the given classes

Page 15: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

> classifier < Marks

> classifier < not Marks

> classifier < not Marks

> classifier < not Marks

> classifier < Marks

> classifier < not Marks

Classifier training

Page 16: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

Classifier application

> Classifier > Marks

Note: The test image does not appear in the training data

Page 17: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

LEARNING IN GENERAL

Page 18: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

The data and the goals

We begin with a collection of positive (and usually negative) examples of a target class (a concept to be learnt)

The goal is to infer a general definition that will allow the learner to recognize future instances of the class

Page 19: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

Knowledge representation

Positive and negative examples can be represented, e.g., in predicate calculus

Two positive instances of the concept of “ball” can be expressed as follows:size(obj1,small) color(obj1,red) shape(obj1,round) size(obj2,large) color(obj2,red) shape(obj2,round)

The general concept of “ball” could be defined by:

size(X,Y) color(X,Z) shape(X,round)

where any sentence that unifies with this general definition represents a ball

Page 20: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

A general model of the learning

process

Page 21: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

A set of operations

Given a set of training instances, the learner must construct a generalization, heuristic rule or plan that satisfies its goals

Page 22: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

The concept space

Representation language and the operations define a space of potential concept definitions

The learner must search this space to find the desired concept

Page 23: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

Heuristic search

Learning programs must commit to a direction and order of search, as well as…

…to the use of available data and heuristics to search efficiently

Page 24: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

PATRICK WINSTON’S PROGRAM ON LEARNING CONCEPTS

Page 25: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

Examples and near misses for the concept “arch”

Page 26: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

Generalization of descriptions to include multiple examples (I)

Page 27: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

Generalization of descriptions to include multiple examples (II)

Page 28: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

Specialization of a description to exclude a near miss

so that this can’t match

Starting with the original

we add special constraints

Page 29: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.
Page 30: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

A BRIEF HISTORY OF AI REPRESENTATIONAL SCHEMES

Page 31: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

Semantic network developed by Collins & Quillian

in their research on human information

storage and response times

Page 32: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

Network representation of properties of…

…snow and ice

Page 33: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

…three definitions of the word “plant”

Three planes representing…

Page 34: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

Intersection path between “cry” and “comfort” (Quillian 1967)

Page 35: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

Case frame representation of the sentence “Sarah fixed thechair with glue.”

Page 36: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

Conceptual dependency theory of four primitive conceptualizations

For example, all actions are assumed to reduce to one or more of the primitive ACTs listed below:

Page 37: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.
Page 38: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

“John ate the egg”

“John prevented Mary from giving a book to

Bill”

Page 39: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

Restaurant script

(Schank and Abelson 1977)

Page 40: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

Restaurant script (continued)

Page 41: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

FRAMES

Page 42: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

A frame includes:

Frame identification information Its relationship to other frames Descriptors of requirements Procedural information on use

of the structure described Frame default information New instance information

Page 43: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

Relationship to other frames

For instance, the “hotel phone” might be a special instance of “phone”, which might be an instance of a “communication device”

Page 44: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

Descriptors of requirements

For instance, a chair has its seat between 20 and 40 cm from the floor, its back higher than 60 cm, etc.

These requirements may be used to determine when new objects fir the stereotype defined by the frame

Page 45: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

Procedural information

An important feature of frames is the ability to attach procedural code to a slot

Page 46: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

Frame default information

These are slot values that are taken to be true when no evidence to the contrary has been found

For instance, chairs have four legs, telephones are pushbutton, hotel beds are made by the staff

Page 47: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

New instance information

Many frame slots may be left unspecified until given a value for a particular instance or when they are needed for some aspect of problem solving

For instance, the color of the bedspread may be left unspecified

Page 48: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

Part of a frame description of a hotel room

“Specialization” indicates a pointer to a superclass

Page 49: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

Spatial frame for viewing a cube (Minsky 1975)

Page 50: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

CONCEPTUAL GRAPHS: A NETWORK LANGUAGE

Page 51: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

Conceptual relations of

different arities

Page 52: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

“Mary gave John the book”

“A dog named emma is brown”

Page 53: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

Examples of restriction…

Page 54: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

…join, and simplify operations

Page 55: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

Inheritance in conceptual graphs

Page 56: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

“Tom believes that Jane likes pizza”

This example shows the use of a propositional concept

Page 57: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.
Page 58: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

RULE BASED EXPERT SYSTEMS

Page 59: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

Architecture of a typical expert system for a particular problem

domain

Page 60: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

Guidelines to determine whether a problem is appropriate for expert system solution (1)

The need for the solution justifies the cost and effort of building an expert system

Human expertise is not available in all situations where it is needed

The problem may be solved using symbolic reasoning

Page 61: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

Guidelines to determine whether a problem is appropriate for expert system solution (2)

The problem domain is well structured and does not require commonsense reasoning

The problem may not be solved using traditional computing methods

Cooperative and articulate experts exist The problem is of proper size and scope

Page 62: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

Reasoning with a typical expert system

Page 63: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

The role of mental or conceptual models in problem solving

Page 64: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

A small system for analysis of automotive problems

Page 65: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

The and/or graph searched in the car diagnosis example

Page 66: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

The production system at the start of a consultation in the car diagnostic example

Imagine that we want to get

information about spark plugs

Page 67: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

The production system after Rule 1 has fired

Page 68: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

The system after Rule 4 has fired

Note the stack-based approach to goal reduction

Page 69: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

The following dialogue begins with the computer asking the user about the goals present in working memory

Page 70: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

CASE BASED REASONING

Page 71: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

Case based reasoners

Share a common structure For each new problem they

– Retrieve appropriate cases from memory– Modify a retrieved case so that it will apply

to the current situation– Apply the transformed case– Save the solution, with a record of success

or failure, for future use

Page 72: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

Possible preference heuristics to help organize the storage and retrieval of cases (1) Goal-directed: Organize cases, at least in

part, by goal descriptions; Retrieve cases that have the same goal as the current situation

Salient-feature: Prefer cases that match the most important features or those matching the largest number of important features

Recency: Prefer cases used most recently

Page 73: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

Possible preference heuristics to help organize the storage and retrieval of cases (2) Specify: Look for as exact as possible

matches of features before considering more general matches

Frequency: Check first the most frequently matched cases

Ease of adaptation: Use first cases most easily adapted to the current situation

Page 74: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

Transformational analogy

Page 75: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

Advantages of rule based approach

Page 76: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

Disadvantages

Page 77: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

Advantages of case based reasoning

Page 78: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

Disadvantages

Page 79: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

Combination of rule based and case based systems

Page 80: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

3 Robotic Planning

Page 81: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

ROBOTIC PLANNING

Page 82: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

The blocks world

Page 83: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

Predicate based representation

Page 84: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

A number of truth relations or rules for robot’s performance

Page 85: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

Portion of the search space

Page 86: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

Goal state for the blocks world

Page 87: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

Descriptor triples

Preconditions (P): Conditions the world must meet for an operator to be applied

Add List (A): Additions to the state description that are a result of applying the operator

Delete List (D): Items that are removed from a state description to create the new state when the operator is applied

Page 88: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

Operators as triples of descriptions

Page 89: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

A simple tree showing condition action rules

Page 90: Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.

THANK YOU