case-based reasoning a type of analogical reasoning

44
Case-based Reasoning A type of analogical reasoning

Upload: geoffrey-greene

Post on 12-Jan-2016

220 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Case-based Reasoning A type of analogical reasoning

Case-based Reasoning

A type of analogical reasoning

Page 2: Case-based Reasoning A type of analogical reasoning

Problem Solving

Humans are extremely good at problem solving

They have evolved that way

Even problems that they seldom encounter or have never encountered before

Page 3: Case-based Reasoning A type of analogical reasoning

Problem Solving Logics

• Deductive Logic

• Inductive Logic

• Abductive Logic

• Analogical Logic

• Description Logic

• Fuzzy Logic

Page 4: Case-based Reasoning A type of analogical reasoning

Analogy and Experience

Page 5: Case-based Reasoning A type of analogical reasoning

Underlying Model of CBR

• Humans are robust problem solvers

• Humans reason from cases in a wide variety of contexts

• Studies abound in how humans reason from cases

Page 6: Case-based Reasoning A type of analogical reasoning

What is CBR?

• Case-based reasoning is [...] reasoning by remembering.

• A case-based reasoner solves new problems by adapting solutions that were used to solve old problems.

• Case-based reasoning is a recent approach to problem solving and learning

• Case-based reasoning models both the ways people use cases to solve problems and the ways in which we can make machines use cases.

Page 7: Case-based Reasoning A type of analogical reasoning

Analogical Reasoning (CBR)

• Case-based reasoning (CBR) is a certain technique which was based on analogical reasoning.

• The main intention is to reuse previous experiences for actual problems.

• The difficulty arises when the actual situation is not identical to the previous one: There is an inexactness involved.

• Its main aspect is that CBR-techniques allow inexact (approximate) reasoning in a controlled manner.

• Here we will shortly describe its main features.• Major applications include fault diagnosis, help desk

systems, eCommerce

Page 8: Case-based Reasoning A type of analogical reasoning

Could be calledSimilarity Based Reasoning

• The central notion in CBR is the concept of similarity. • The methods in CBR have been extended in a way which

allows applications to other problems rather than reusing previous experiences:– in electronic commerce e.g. to product selection.

• This is due to an abstract formulation of the similarity concept.

• In particular, the main algorithms of CBR can still be applied to these new situations.

• We will first describe the original technique informally and then proceed to the extensions.

Page 9: Case-based Reasoning A type of analogical reasoning

Research in CBR

• ECCBR 2012 - European Conference on Case-Based Reasoning

• ICCBR 2013 - International Conference on Case based Reasoning

Page 10: Case-based Reasoning A type of analogical reasoning

Case-Based Reasoning (CBR)

• Basic Ideas:– Store previous experience (case)– Solve new Problems by selecting and reusing cases– Store new experience again

• Replaces 0-1-logic by approximation• Is a well-founded technology:

– Mathematically– Algorithmically– With respect to software technology– Supported by experiments and applications– Business success

• Most successful recent branch of AI

Page 11: Case-based Reasoning A type of analogical reasoning

What is a Case ?

• A case has two parts:– Description of a problem or a set of problems

(generalized case)– Description of the solution of this problem

(formally or informally)• Possibly additions like explanations, comments on the

quality of the solution etc.

• Cases represent experiences : They record how a problem was solved in the past

Page 12: Case-based Reasoning A type of analogical reasoning

Different Case Representations

Free text: textual CBR

Database like representations: structural CBR

Page 13: Case-based Reasoning A type of analogical reasoning

Structured Case Representation• Many different case representations are used Depend on

requirements of domain and task– Structure of already available case data

• Flat feature-value list– Simple case structure is sometimes sufficient for problem solving– Easy to store and retrieve in a CBR system

• Object-oriented representations– Case: collection of objects (instances of classes) – Required for complex and structured objects

Page 14: Case-based Reasoning A type of analogical reasoning

How to Use a Case

Solution ?

Solution adaptation

ProblemProblemof the case

Solutionof the case

In general, there is no guarantee for getting good solutionsbecause the case may be „too far away“ from the problem. Therefore the problem arises how to define when a case is “good enough”.

Page 15: Case-based Reasoning A type of analogical reasoning

How to Use a Case-Base

• A case base is a data base of cases• If a new problem arises one will use a case from the

case base in order to solve the problem• If we have many cases then the chance is higher to

find one with a suitable solution• Because the given problem is usually not exactly in

the base one wants to retrieve a case which solved a problem which is „similar enough to be useful“

• Hence, the notion of similarity is central to CBR• The concept of similarity based retrieval is compared

with data base retrieval

Page 16: Case-based Reasoning A type of analogical reasoning

Components of CBR

Solutiontrans-

formation

Casebase

Vocabulary Similarity measure

DataInformationKnowledge

StorageCompilation

Cases have notto be understood inorder to be stored

In order to solve problems one needs knowledge. Where is it located: In knowledge containers.

A task of knowledge management is the maintenance of the containers.

Page 17: Case-based Reasoning A type of analogical reasoning

The Classical CBR Algorithm

Retrieve:

Determine most similar case(s).

Reuse:

Solve the new problem re-using information and knowledge in the retrieved case(s).

Revise:

Evaluate the applicability of the proposed solution in the real-world.

Retain:

Update case base with new learned case for future problem solving.

Ret

riev

eReuse

Rev

ise

RetainCaseBase

Knowledge

NewCase

NewCaseRetrieved

Case

SolvedCase

LearnedCase

Tested/Repaired

Case

SuggestedSolution

Problem

ConfirmedSolution

This cycle shows the main activities in CBR

Page 18: Case-based Reasoning A type of analogical reasoning

Typical Problems Handled with CBR: Classification and Diagnosis

• A class is a certain subset of some universe and a classification assigns to each element one or more classes to which it belongs.

• In fault diagnosis the classification is only the first step:

Observations diagnosis repair

classification Domain rules

Diagnosis occurs frequently in after sales support

Page 19: Case-based Reasoning A type of analogical reasoning

An Example OverviewTypical Scenario: Call Center

• Technical Diagnosis of Car Faults:– symptoms are observed (e.g., engine doesn’t start) and

values are measured (e.g., battery voltage = 6.3V)

– goal: Find the cause for the failure (e.g., battery empty) anda repair strategy (e.g., charge battery)

• Case-Based Diagnosis:– a case describes a diagnostic situation and contains:

• description of the symptoms

• description of the failure and the cause

• description of a repair strategy

– store a collection of cases in a case base

– find case similar to current problem and reuse repair strategy

Page 20: Case-based Reasoning A type of analogical reasoning

A Simple Example (II)What does a Case Look Like?

• A case describes one particular diagnostic situation• A case records several features and their specific values

occurred in that situation

A case is not a ( general) rule !!Feature Value

Problem (Symptoms)• Problem: Front light doesn’t work• Car: VW Golf IV, 1.6 l• Year: 1998• Battery voltage: 13,6 V• State of lights: OK• State of light switch: OK

Solution• Diagnosis: Front light fuse defect• Repair: Replace front light fuse

CASE

1

Page 21: Case-based Reasoning A type of analogical reasoning

A Case Base With Two Cases

• Each case describes one particular situation

• All cases are independent of each other

Problem (Symptoms)• Problem: Front light doesn’t work• Car: VW Golf III, 1.6 l• Year: 1996• Battery voltage: 13,6 V• State of lights: OK• State of light switch: OK

Solution• Diagnosis: Front light fuse defect• Repair: Replace front light fuse

CASE

1

Problem (Symptoms)• Problem: Front light doesn’t work• Car: Audi A4• Year: 1997• Battery voltage: 12,9 V• State of lights: surface damaged• State of light switch: OK

Solution• Diagnosis: Bulb defect• Repair: Replace front light

CASE

2

Page 22: Case-based Reasoning A type of analogical reasoning

Solving a New Diagnostic Problem

• A new problem has to be solved• We make several observations in the current situation• Observations define a new problem• Not all feature values have to be known

Note: The new problem is a “case” without solution part

FeatureValue

Problem (Symptom):• Problem: Break light doesn’t work• Car: Audi 80• Year: 1989• Battery voltage: 12.6 V• State of Lights: Surface damaged• State of light switch: OK

Page 23: Case-based Reasoning A type of analogical reasoning

You are required to identify between case 1 and case 2 the case that is most similar to to the problem case

• When are two cases similar?• How to rank the cases according to their similarity?

Similarity is the most important concept in CBR !!

• We can assess similarity based on the similarity of each feature• Similarity of each feature depends on the feature value.• BUT: Importance of different features may be different

New ProblemNew Problem

CASE

x

Similar?Similar?

Compare the New Problem with Each Case and Select the Most Similar Case :

Page 24: Case-based Reasoning A type of analogical reasoning

Class ExerciseCase 1 (Symptoms)

Problem: Front light doesn’t workCar: VW Golf III, 1.6 lYear: 1996Battery voltage: 13,6 VState of lights: OKState of light switch: OK

SolutionDiagnosis: Front light fuse defectRepair: Replace front light fuse

Case 2 (Symptoms)Problem: Front light doesn’t workCar: Audi A4Year: 1997Battery voltage: 12,9 VState of lights: surface damagedState of light switch: OK

SolutionDiagnosis: Bulb defectRepair: Replace front light

New Problem Case Problem: Break light doesn’t workCar: Audi 80Year: 1989Battery voltage: 12.6 VState of Lights: Surface damagedState of light switch: OK

Which case is most similar to the problem case?

Page 25: Case-based Reasoning A type of analogical reasoning

A similarity algorithm

• Assignment of similarities for features values.

• Express degree of similarity by a real number between 0 and 1

• Examples: – Feature: Problem

– Feature: Battery voltage (similarity depends on the difference)

• Different features have different importance (weights)!– High importance: Problem, Battery voltage, State of light, ...

– Low importance: Car, Year, ...

Not similar Very similar

Front light doesn’t work Break light doesn’t work

Front light doesn’t work Engine doesn’t start

0.8

0.4

12.6 V 13.6 V

12.6 V 6.7 V

0.9

0.1

Page 26: Case-based Reasoning A type of analogical reasoning

Compare Similarity

• Similarity computation by weighted average similarity(new,case 2) = 1/20 * [ 6*0.8 + 1*0.8 + 1*0.4 + 6*0.95 + 6*0 ] = 0.585

Case 1 is more similar: due to feature “State of lights”

Problem (Symptom)• Problem: Break light doesn’t work• Car: Audi 80• Year: 1989• Battery voltage: 12.6 V• State of lights: OK

Problem (Symptoms)• Problem: Front light doesn’t work• Car: Audi A4• Year: 1997• Battery voltage: 12.9 V• State of lights: surface damaged• State of light switch: OK

Solution• Diagnosis: Front light fuse defect• Repair: Replace front light fuse

0.80.80.40.950

Very important feature: weight = 6

Less important feature: weight = 1

Page 27: Case-based Reasoning A type of analogical reasoning

Compare Similarity

• Similarity computation by weighted average similarity(new,case 1) = 1/20 * [ 6*0.8 + 1*0.4 + 1*0.6 + 6*0.9 + 6* 1.0 ] = 0.86

Problem (Symptom)• Problem: Break light doesn’t work• Car: Audi 80• Year: 1989• Battery voltage: 12.6 V• State of lights: OK

Problem (Symptoms)• Problem: Front light doesn’t work• Car: VW Golf III, 1.6 l• Year: 1996• Battery voltage: 13.6 V• State of lights: OK• State of light switch: OK

Solution• Diagnosis: Front light fuse defect• Repair: Replace front light fuse

0.80.40.60.91.0

Very important feature: weight = 6

Less important feature: weight = 1

Page 28: Case-based Reasoning A type of analogical reasoning

Case adaption algorithm

• New Solution:• Diagnosis: Break light fuse defect• Repair: Replace break light fuse

Problem (Symptom):• Problem: Break light doesn’t work• Car: Audi 80• Year: 1989• Battery voltage: 12,6 V• State of light: OK

Adapt Solution:

How do differences in the problem affect the solution?

Problem (Symptoms):

• Problem: Front light doesn’t work

• ...

Solution:

• Diagnosis: Front light fuse defect

• Repair: Replace front light fuse

CASE

1

Page 29: Case-based Reasoning A type of analogical reasoning

New case inserted into the case library ??

CASE

3

Problem (Symptoms):• Problem: Break light doesn’t work• Car: Audi 80• Year: 1989• Battery voltage: 12.6 V• State of lights: OK• State of light switch: OK

Solution:• Diagnosis: break light fuse defect• Repair: replace break light fuse

If diagnosis is correct:Store new case in the memory.

Page 30: Case-based Reasoning A type of analogical reasoning

The Classical CBR R4-Cycle[from: Aamodt & Plaza, 1994]

Retrieve:

Determine most similar case(s).

Reuse:

Solve the new problem re-using information and knowledge in the retrieved case(s).

Revise:

Evaluate the applicability of the proposed solution in the real-world.

Retain:

Update case base with new learned case for future problem solving.

Ret

riev

eReuse

Rev

ise

RetainCaseBase

Knowledge

NewCase

NewCaseRetrieved

Case

SolvedCase

LearnedCase

Tested/Repaired

Case

SuggestedSolution

Problem

ConfirmedSolution

This cycle shows the main activities in CBR

Page 31: Case-based Reasoning A type of analogical reasoning

Retrieve: Modeling Similarity• The similarity based retrieval realizes an inexact match

which is still useful:– Useful solutions from a case base– Useful products from a product base

• Different approaches depending on case representation• Similarity measures:

– Are functions to compare two cases sim: Case x Case [0..1]

– Local similarity measure: similarity on feature level– Global similarity measure: similarity on case or object level

Page 32: Case-based Reasoning A type of analogical reasoning

Similarities (1)

• Similarities are described by measures with numerical values

• They operate on – problem descriptions, demands, products ,...

Intention: •The more similar two problem descriptions C and D are, the more useful it is two use one of the solutions alsofor the other problem. •The more similar a demand and a product are the moreuseful is the product for satisfying the demand.

Page 33: Case-based Reasoning A type of analogical reasoning

Similarities and Inexact Reasoning

• The similarity measure controls the utility when inexact solutions are employed or the desired product is not exactly as desired available.

Page 34: Case-based Reasoning A type of analogical reasoning

A Typical Similarity Measure

• Given two problem descriptions C1, C2• p attributes y1, ..., yp used for the representation

p

1jjj (C1,C2)simSIM(C1,C2) ω

simj : similarity for attribute yj (local measure)wj : describes the relevance of attribute j for the problem

Page 35: Case-based Reasoning A type of analogical reasoning

Nearest Neighbor

• Problem: Should a person be granted a load or not (Ian Watson Slide)

• Depends on Monthly income and loan amount.• The loan decisions will be clustered

Page 36: Case-based Reasoning A type of analogical reasoning

Retrieval: Finding The Nearest Neighbor

• For a new problem C the nearest neighbor in the case base is the case (D,L) for which problem D has the greatest similarity to C.

• Its solution L is intended to be most useful and is then the best solution the case base can offer (or best available product).

• Classical databases use always total similarity (i.e. equality).

• The access to data in databases is in similarity based systems replaced by the search for the nearest neighbor. It can be regarded as an optimization process.

This requires more effort but can be much more useful.

Page 37: Case-based Reasoning A type of analogical reasoning

Thresholds

• The nearest neighbor (in the given case base) is not always sufficient for providing an acceptable solution.

• On the other hand, a case which is not the nearest neighbor may be sufficient enough.

• For this purpose one can introduce two thresholds and , 0 < < < 1 with the intention– If sim(newproblem, caseproblem) < then the case is not accepted;– If sim(newproblem, caseproblem) > then the case is accepted.

• This partitions this case base (for the actual problem into three parts: accepted cases, unaccepted cases and an uncertainty set. The same works for product bases.

Page 38: Case-based Reasoning A type of analogical reasoning

Retrieve: Efficiency Issues• Efficient case retrieval is essential for large case bases

and large product spaces.• Different approaches depending

– on the representation– complexity of similarity computation – size of the base

• Organization of the base: – Linear lists, only for small bases– Index structures for large bases, e.g., kd-trees,

• How to store cases or products: – Databases: for large bases or if shared with other applications– Main memory: for small bases, not shared

Page 39: Case-based Reasoning A type of analogical reasoning

Reuse: How to Adapt the Solution

• No modification of the solution: just copy. Manual/interactive solution adaptation by the user.

• Automatic solution adaptation :– Transformational Analogy: transformation of the solution

• Rules or operators to adjust solution w.r.t. differences in the problems

• Knowledge required about the impact of differences

– Compositional adaptation: combine several cases to a single solution

Page 40: Case-based Reasoning A type of analogical reasoning

Summary

• CBR is a technique for solving problems based on experience

• CBR problem solving involves four phases:

Retrieve, Reuse, Revise, Retain

• CBR systems store knowledge in four containers:

Vocabulary, Case Base,

Similarity Concept, Solution Adaptation

• Large variety of techniques for:

– representing the knowledge, in particular, the cases

– realizing the different phases

• CBR has several advantages over traditional KBS

• The basic techniques of CBR can be extended to the needs of E-Commerce.

Some Slides adapted from:Dr. Michael Richter and Dr. Ralph Bergman, University of Kaiserslauternand University of Calgary AI Resources

Page 41: Case-based Reasoning A type of analogical reasoning

CBR(Experience)

KBS NN GA FL

Know. rep. 3 4 1 2 4

Approximation (exact matching vs approx matching)

1 1 4 4 4

Adaptable 4 2 4 4 2

Learnable 3 1 4 4 2

Interpretable 3 4 1 2 4

Learns from scratch 4 1 4 1 3

Table 1 (Adapted from [Abr, Jac] and [Neg]). A comparison of the utility of case based reasoning systems (CBR), rule induction systems (RI), neural networks (NN) genetic algorithms (GA) and fuzzy systems (FS), with 1 representing low and 4 representing a high utility.

Page 42: Case-based Reasoning A type of analogical reasoning

Case Based Reasoning Algorithm

Ret

riev

e

Reuse

Rev

ise

RetainCaseBase

Knowledge

NewCase

NewCaseRetrieved

Case

SolvedCase

LearnedCase

Tested/Repaired

Case

SuggestedSolution

Problem

ConfirmedSolution

Page 43: Case-based Reasoning A type of analogical reasoning

Case Based Forecasting

Page 44: Case-based Reasoning A type of analogical reasoning

Case Base in Java