case-based reasoning a type of analogical reasoning
TRANSCRIPT
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
Problem Solving Logics
• Deductive Logic
• Inductive Logic
• Abductive Logic
• Analogical Logic
• Description Logic
• Fuzzy Logic
Analogy and Experience
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
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.
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
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.
Research in CBR
• ECCBR 2012 - European Conference on Case-Based Reasoning
• ICCBR 2013 - International Conference on Case based 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
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
Different Case Representations
Free text: textual CBR
Database like representations: structural CBR
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
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”.
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
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.
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
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
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
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
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
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
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 :
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?
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
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
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
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
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.
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
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
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.
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.
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
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
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.
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.
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
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
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
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.
Case Based Reasoning Algorithm
Ret
riev
e
Reuse
Rev
ise
RetainCaseBase
Knowledge
NewCase
NewCaseRetrieved
Case
SolvedCase
LearnedCase
Tested/Repaired
Case
SuggestedSolution
Problem
ConfirmedSolution
Case Based Forecasting
Case Base in Java