Presentation is loading. Please wait.

Presentation is loading. Please wait.

Case Based Reasoning Lecture 2: CBR Case Retrieval.

Similar presentations


Presentation on theme: "Case Based Reasoning Lecture 2: CBR Case Retrieval."— Presentation transcript:

1 Case Based Reasoning Lecture 2: CBR Case Retrieval

2 Outline Case Representation Nearest Neighbour Retrieval Calculating similarity Similarity in CBR-Works Reading

3 R 4 Cycle REUSE propose solutions from retrieved cases REVISE adapt and repair proposed solution CBR RETAIN integrate in case-base RETRIEVE find similar problems

4 CBR Assumption New problem can be solved by retrieving similar problems adapting retrieved solutions Similar problems have similar solutions ? S SS S S S S S S P P P P P P P P P X

5 Car Diagnosis Example Symptoms are observed Engine does not start Battery voltage = 7v Goal Cause of failure: flat battery Repair strategy: charge battery

6 Case-Based Diagnosis Case describes diagnostic situation Description of symptoms Description of fault Description of repair strategy Case-base stores a collection of cases CBR finds case in case-base similar to new symptoms Re-uses diagnosis of fault repair strategy

7 Car Diagnosis Case Each case describes one diagnostic situation Described by a list of features Contains a list of feature values Problem Symptom: headlight does not work Car: Ford Mondeo Year: 2001 Solution Diagnosis: headlight fuse blown Repair: replace headlight fuse This is not a rule - why not? Battery: 10.4v Headlights: undamaged HeadlightSwitch: on FeatureValue Case 1

8 Case 2 Case 1 Car Diagnosis Case-Base A collection of independent cases Problem Symptom: headlight does not work Car: Ford Mondeo Year: 2001 Solution Diagnosis: headlight fuse blown Repair: replace headlight fuse Problem Symptom: headlight does not work Car: Ford Ka Year: 2003 Solution Diagnosis: defective bulb Repair: replace headlight Battery: 10.4v Headlights: undamaged HeadlightSwitch: on Battery: 9.5v Headlights: surface damage HeadlightSwitch: on

9 Case Representation Depends on problem domain Flat structure A list of feature values (car diagnosis example) Easy to store and retrieve Specialised representations Graphs - nodes and arcs Plans - partially ordered set of actions Object-oriented - objects (instances of classes) More difficult to store and retrieve

10 Case Representation Object-oriented representation: A case is a set of objects An object is described by a set of features Classes are arranged in a hierarchy Relations between objects (e.g. part-of) Combine similarities of parts Car BrakesEngine Transmission Ignition SystemFuel Injection CoilSpark Plug Colour: dark grey Gap: 1.2mm

11 New Car Diagnosis Problem A new problem is a case without a solution part Not all problem features must be known same for cases Problem Symptom: brakelight does not work Car: Ford Fiesta Year: 1997 Battery: 9.2v Headlights: undamaged HeadlightSwitch: ? Feature Value New

12 Compare new problem to each case Select most similar Similarity is most important concept in CBR When are two cases similar? How are cases ranked according to similarity? Similarity of cases Similarity for each feature Depends on feature values Retrieving A Car Diagnosis Case New Problem Case Case 1 Similar?

13 Nearest Neighbour Retrieval Retrieve most similar k-nearest neighbour (k-NN) like scoring in bowls or curling Example 1-NN 5-NN …

14 Calculating Feature Similarity Distances between values of individual features problem and case have values p and c for feature f Distance for Numeric features d f (problem,case) = |p - c|/(max difference) Distance for Symbolic features d f (problem,case)= 0 if p = c = 1 otherwise Similarity f (problem,case) = 1 - d Degree of similarity is between 0 and 1

15 Calculating Case Similarity Similarity(problem,case) = weighted sum of Similarity f (problem,case) for all features f High importance features have large weight symptom, battery, headlights weight = 6 Low importance features have low weight car, year weight = 1 Case similarity = s i is similarity of i th feature w i is weight of i th feature w 1 *s 1 + w 2 * s 2 + …… + w n *s n w 1 + w 2 + …… + w n

16 New Problem and Case 1 New Problem Symptom: brakelight does not work Car: Ford Fiesta Year: 1997 Battery: 9.2v Headlights: undamaged HeadlightSwitch: ? weight = 61 Problem Symptom: headlight does not work Car: Ford Mondeo Year: 2001 Battery: 10.4v Headlights: undamaged HeadlightSwitch: on Solution Diagnosis: headlight fuse blown Repair: replace headlight fuse Similarity(New, Case 1) = 6* * * * * = 17.4 / 20 = 0.87 Similarity Case 1

17 New Problem and Case 2 New Problem Symptom: brakelight does not work Car: Ford Fiesta Year: 1997 Battery: 9.2v Headlights: undamaged HeadlightSwitch: ? weight = 61 Problem Symptom: headlight does not work Car: Ford Ka Year: 2003 Battery: 9.5v Headlights: surface damage HeadlightSwitch: on Solution Diagnosis: defective bulb Repair: replace headlight Similarity(New, Case 2) = 6* * * * * = / 20 = 0.59 Case 2 Similarity

18 Reuse Solution from Case 1 New Problem Symptom: brakelight does not work Car: Ford Fiesta Year: 1997 Battery: 9.2v Headlights: undamaged HeadlightSwitch: ? Problem Symptom: headlight does not work … Solution Diagnosis: headlight fuse blown Repair: replace headlight fuse Solution to New Problem Diagnosis: headlight fuse blown Repair: replace headlight fuse After Adaptation Diagnosis: brakelight fuse blown Repair: replace brakelight fuse Case 1

19 CBR-Works Similarity Calculation in tool used in the Lab Unordered Symbols Ordered Symbols Numbers Intervals Strings Taxonomy

20 Symbols (Unordered) Similarity defined by developer Similarity values stored in a decision table

21 Symmetric vs Asymmetric Similarity In symmetric similarity the result is independent of the role of the values being compared Sim (amber, green) = 0.8 Sim (green, amber) = 0.8 In asymmetric similarity the role is important Sim (amber, green) = 0.3 Sim (green, amber) = 0.8

22 Ordered Symbols The symbols are mapped to a numeric range Colour BrightnessLightMediumDark Light Medium Dark

23 Numbers d f (query,case) = |q - c|/range Similarity f (query,case) = 1 – d Example: Query (New Problem): Mileage = 60,000 Case: Mileage = 50,000 Range (Mileage) = ,000 d Mileage (query,case) = |60,000 – 50,000|/10,0000 = 0.1 Similarity Mileage (query,case) = 1 – 0.1 = 0.9

24 Intervals if the intervals in query and case do not intersect the similarity is higher the closer the gap if the intervals intersect the similarity is higher the closer the bounds if the case completely covers the query the similarity is 1 if the query completely covers the case the similarity is higher the closer the bounds

25 Strings exact match: two strings are similar if they are spelled the same way spelling check: compares the number of letters which are the same in two strings (Useful for strings consisting of one word only) word-count: counts the number of matching words of two cases. (Useful for strings consisting of several words).

26 Taxonomy A classification hierarchy defines similarity for concepts Inner nodes of the tree are assigned similarity values Leaves under a node will share the nodes similarity

27 Example from CBR-Works

28 d Mileage (query,case1) = | |/(100000) =0.1 S Mileage (query,case1) = 1 – 0.1 = 0.9 d Towbar (query,case1) = 0 S Towbar (query,case1) = 1 – 0 = 1 S(query,case1) = ( ) / (1 + 1) = 0.95 Note that the missing values (?) do not contribute to the calculation

29 Reading Text D.B. Leake. Case-Based Reasoning: Experiences, Lessons and Future Directions. MIT Press,1996. Seminal Paper A. Aamodt & E. Plaza. Case-based Reasoning: Foundational Issues, Methodological Variations, and System Approaches. AICOM 7(1):39-59, ftp://ftp.ifi.ntnu.no/pub/Publikasjoner/vitenskaplige-artikler/aicom-94.pdf


Download ppt "Case Based Reasoning Lecture 2: CBR Case Retrieval."

Similar presentations


Ads by Google