1 / 39

Case Base Reasoning

Case Base Reasoning. M.Fatih AMASYALI Uzman Sistemler Ders Notları. C ase B ase R easoning (CBR). p ?. p ?. CBR(problem) = solution. Problem Space. p 3. p 2. p 1. Solution Space. s 4. s 3. s 1. s 2. CBR. 3 Approaches to Case Based Reasoning Structural Approach Textual Approach

rinah-jones
Download Presentation

Case Base Reasoning

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Case Base Reasoning M.Fatih AMASYALI Uzman Sistemler Ders Notları

  2. Case Base Reasoning (CBR) p? p? CBR(problem) = solution Problem Space p3 p2 p1 Solution Space s4 s3 s1 s2

  3. CBR 3 Approaches to Case Based Reasoning Structural Approach Textual Approach Conversational Approach

  4. Structural ApproachPredicate Logic Representation Symptoms: Solution: • Diagnosis: • Front-lights-safeguard = broken • Help measures: • “Replace front lights safeguard” • Front-light = doesn’t work • Car-type = Golf II, 1.6 • Year = 1993 • Batteries = 13.6V • … predicate term Problem/Solution from a case can be represented through predicates: Case: Case( symptoms(frontLight(dw), carType(GolfII_1.6), year(1993), batteries(13.6),…), diagnosis(broken(fls), measures(rfls)))

  5. Structural Approach • Format of the cases (XML): • <case> • <name>text</name> • <symptoms> • <attribute1>value1</attribute1> • <attribute2>value2</attribute2> • … • </symptoms> • <solution> • <attribute>value</attribute> • <helpMeasures>text</helpMeasures> • </solution> • </case>

  6. Textual Approach Cases recorded as free text Large collection of documents Easy Case Acquisition Keyword Matching (detaylar sonda) Example: Frequently Asked Questions

  7. Conversational Approach:CCBRSteps Input of problem description Qd Computation of similarity s(Q,C) Display of solutions of top ranked cases, Ds and unanswered questions, Dq Selection by user Re-computation of similarity Successful/Unsuccessful Termination

  8. Generic CCBR problem solving process Kullanıcı ya bir çözüm seçer Ya da bir soru seçip cevaplar Çözümü seçtiğinde işlem biter, soru seçtiğinde cevaplar ve benzerlik tekrar hesaplanır.

  9. Problem Description • Input: a collection of cases CB = {C1, …Cn} and a new problem P • Output: • The most similar case: A case Ci in CB such that sim(Ci, P) is minimal, or • A collection of m most similar cases in CB {Ci,…, Cj}, or • A sufficiently similar case: case Ci in CB such that sim(Ci, P) > th where th is a predefined threshold

  10. Sistemi iyileştirmek Kullandıkça iyileşen bir sistemi nasıl tasarlarsınız? 10

  11. DEFAULT KNOWLEDGE A surprisingly powerful form of knowledge is "default knowledge." This is knowledge which is assumed to be true about anobject unless specified otherwise. For example, a person object in a medical expert system may include default knowledge such as the following: Each person is assumed to have two arms, two eyes, two kidneys, two lungs, and so on. Only for persons wholack two of a specific organ or body part is it necessary to specify any additional information.

  12. Computing Similarity • Similarity is the key concept in CBR

  13. Meaning of Similarity • Observation 1: Similarity always concentrates on one aspect or task: • There is no absolute similarity • Example: • Two cars are similar if they have similar capacity (two compact cars may be similar to each other but not to a full-size car) • Two cars are similar if they have similar price (a new compact car may be similar to an old full-size car but not to an old compact car)

  14. Meaning of Similarity (2) • Observation 2: Similarity is not always transitive: • Example: • I define similar to mean “within walking distance” • “Lehigh’s book store” is similar to “Café Havana” • “Café Havana” is similar to “Perkins” • “Perkins” is similar to “Monrovia book store” • … • But: “Lehigh’s book store” is not similar to “Monrovia book store” ! • The problem is that the property “small difference” cannot be propagated

  15. Meaning of Similarity (3) • Observation 3: Similarity is not always symmetric: • Example: • “Mike Tyson fights like a lion” • But do we really want to say that “a lion fights like Mike Tyson”?

  16. Axioms for Similarity • There are 3 types of axioms: • Binary similarity predicate “x and y are similar” • Binary dissimilarity predicate “x and y are dissimilar” • Similarity as order relation: “x is at least as similar to y as it is to z” • Observation: • The first and the second are equivalent • The third provides more information: grade of similarity

  17. Similarity Metric • We want to assign a number to indicate the similarity between a case and a problem • Definition: A similarity metric over a set M is a function: • sim: M  M  [0,1] • Such that: • For all x in M: sim(x,x) = 1 holds • For all x, y in M: sim(x,y) = sim(y,x) “ the closer the value of sim(x,y) to 1, the more similar is x to y”

  18. Distance Metric • Definition: A distance function over a set M is a function: • d: M  M  [0,) • Such that: • For all x in M: d(x,x) = 0 holds • For all x, y in M: d(x,y) = d(y,x) • Definition: A distance function over a set M is a metric if: • For all x, y in M: d(x,y) = 0 holds then x = y • For all x, y, z in M: d(x,z) + d(z,y)  d(x,y)

  19. Relation between Similarity and Distance Metric (3) • F(x) can be used to construct sim giving d. Example of such a function is: • if you have the Euclidean distance: • d((x,y),(u,v)) = sqr((x-u)2 + (y-v)2) • Since f(x) = 1 – (x/(x+1)) meets the property before • Then: • sim((x,y),(u,v))) = f(d((x,y),(u,v))) • = 1 – (d((x,y),(u,v)) /(d((x,y),(u,v)) +1)) • is a similarity metric

  20. Relation between Similarity and Distance Metric (3) • The function f(x) = 1 – (x/(x+1)) is a bijective function from [0,) into (0,1]: 1 0 Find another order-inverting function and prove it?

  21. Other Similarity Metrics • Suppose that we have cases represented as attribute-value pairs (e.g., the restaurant domain) • Suppose initially that the values are binary • We want to define similarity between two cases of the form: • X = (X1, …, Xn) where Xi = 0 or 1 • Y = (Y1, …,Yn) where Yi = 0 or 1

  22. Preliminaries • Let: • A = (i=1,n)Xi•Yi • B = (i=1,n)Xi•(1-Yi) • C = (i=1,n)(1-Xi)•Yi • D = (i=1,n)(1-Xi) •(1-Yi) • Then, A + B + C + D = (number of attributes for which Xi =1 and Yi = 1) (number of attributes for which Xi =1 and Yi = 0) (number of attributes for which Xi =0 and Yi = 1) (number of attributes for which Xi =0 and Yi = 0) n “matching attributes” “mismatching attributes” A+D = B+C=

  23. Hamming Distance H(X,Y) = n –(i=1,n)Xi•Yi–(i=1,n)(1-Xi)•(1-Yi) • Properties: • Range of H: • H counts the mismatch between the attribute values • H is a distance metric: • H((1-X1, …, 1-Xn), (1-Y1, …,1-Yn)) = [0,n] • H(X,X) = 0 • H(X,Y) = H(Y,X) H((X1, …, Xn), (Y1, …,Yn))

  24. Proportion of the difference # of mismatches Simple-Matching-Coefficient (SMC) n – (A + D) = B + C • H(X,Y) = • Another distance-similarity compatible function is • f(x) = 1 – x/max (where max is the maximum value for x) • We can define the SMC similarity, simH: simH(X,Y) = 1 – ((n – (A+D))/n) = (A+D)/n = 1- ((B+C)/n)

  25. Variations of the SMC • The hamming similarity assign equal value to matches (both 0 or both 1) • There are situations in which you want to count different when both match with 1 as when both match with 0 • Thus, sim((1-X1, …, 1-Xn), (1-Y1, …,1-Yn)) = sim((X1, …, Xn), (Y1, …,Yn)) may not hold • Example: Two symptoms of patients are similar if they both have fever (Xi = 1 and Yi = 1) but not similar if neither have fever (Xi = 0 and Yi = 0) • Specific attributes may be more important than other attributes Example: manufacturing domain: some parts of the workpiece are more important than others

  26. Variations of SMC (III) • simH(X,Y) = (A+D)/n = (A+D)/(A+B+C+D) • We introduce a weight, , with 0 <  < 1: sim(X,Y) = ((A+D))/ ((A+D) + (1 - )(B+C)) • For which  is sim(X,Y) = simH(X,Y)?  = 0.5 • sim(X,Y) preserves the monotonic and symmetric conditions

  27. 1  > 0.5  = 0.5  < 0.5 0 n 0 The similarity depends only from A, B, C and D (3) • What is the role of ? What happens if  > 0.5? If  < 0.5? sim(X,Y) = ((A+D))/ ((A+D) + (1 - )(B+C)) • If  > 0.5 we give more weights to the matching attributes than to the miss-matching • If  < 0.5 we give more weights to the miss-matching attributes than to the matching

  28. Discarding 0-match • Thus, sim((1-X1, …, 1-Xn), (1-Y1, …,1-Yn)) = sim((X1, …, Xn), (Y1, …,Yn)) may not hold • Only when the attribute occurs (i.e., Xi = 1 and Yi = 1 ) will contribute to the similarity • Possible definition of the similarity: sim = A / (A+ B+C)

  29. Specific Attributes may be More Important Than Other Attributes • Significance of the attributes varies • Weighted Hamming distance: • There is a weight vector: (1, …, n) such that • (i=1,n) i = 1 HW(X,Y) = 1 –(i=1,n) i • Xi•Yi–(i=1,n) i • (1-Xi)•(1-Yi) • Example: “Process planning: some features are more important than others”

  30. Attributes May Have multiple Values • X = (X1, …, Xn) where Xi Ti • Y = (Y1, …,Yn) where Yi Ti • Each Ti is finite • a formula for the Hamming distance in this context ?

  31. P S A B C Tversky Contrast Model • Comparison of a situation S with a prototype P (i.e, a case) • S and P are sets of features • The following sets: • A = S  P • B = P – S • C = S – P

  32. Tversky Contrast Model (2) • Tversky-distance: • Where f:  [0, ) • f, , , and  are fixed and defined by the user • Example: • If f(A) = # elements in A •  =  =  = 1 • T counts the number of elements in common minus the differences T(P,S) = f(A) - f(B) - f(C)

  33. Kelimelerin Anlamsal Benzerliğini Bulma İki temel yaklaşım Bağ sayma Taksonomi (kavramsal ağaç) yeterli. Ortak/ Müşterek bilgi (Mutual Information) Taksonomi ve corpus kullanır. YILDIZ TEKNİK ÜNİVERSİTESİ BİLGİSAYAR MÜHENDİSLİĞİ BÖLÜMÜ

  34. Leacock & Chodorow (1998) len(c1,c2)iki synset arasındaki en kısa yolun uzunluğu.(benzerlik değeriyle ters orantılı) L, tüm taksonominin derinliği YILDIZ TEKNİK ÜNİVERSİTESİ BİLGİSAYAR MÜHENDİSLİĞİ BÖLÜMÜ

  35. Wu & Palmer (1994) • N1veN2: c1 ve c2’nin en yakın ortak üst synset’lerine ( lcs(c1,c2) ) IS-A bağlarıyla uzaklıkları (benzerlik değeriyle ters orantılı) • N3, en yakın ortak üst synset’in kök synset’e IS-A bağlarıyla uzaklığı (büyüklüğü ortak üst synset’in spesifikliğini gösterir, benzerlikle doğru orantılı) YILDIZ TEKNİK ÜNİVERSİTESİ BİLGİSAYAR MÜHENDİSLİĞİ BÖLÜMÜ

  36. Bir kavramın bir korpus’taki olasılığı = corpus’ta geçme sayısı (frekansı) Jiang-Conrath (1997)- Lin (1998) P(concept) = freq(concept)/freq(root) freq(x) korpusta x synset’inin tepesinde bulunduğu tüm synset’lerin frekanslarının toplamı freq(x) = f(x)+f(x1)+f(x2)+f(x21)+f(x22) x x1 x2 x21 x22 YILDIZ TEKNİK ÜNİVERSİTESİ BİLGİSAYAR MÜHENDİSLİĞİ BÖLÜMÜ

  37. Jiang-Conrath (1997)- Lin (1998) A B root A B lcs(c1,c2) c2 lcs(c1,c2)en yakın ortak üst synset c1 • A, her iki kavramı da içeren en spesifik kavramı kullanır • (İki kavramın beraber geçtiği doküman sayısına benzer) • B, iki kavramdan herhangi birini içeren doküman sayısına benzer YILDIZ TEKNİK ÜNİVERSİTESİ BİLGİSAYAR MÜHENDİSLİĞİ BÖLÜMÜ

  38. Benzerlik Metotlarının Karşılaştırılması Bütün metotlar İngilizce 38 kelime çiftine uygulanmış. Bulunan benzerlik değerlerinin, insan yargılarıyla olan korelasyonları yandaki tabloda. YILDIZ TEKNİK ÜNİVERSİTESİ BİLGİSAYAR MÜHENDİSLİĞİ BÖLÜMÜ

  39. Kaynaklar http://www.ise.gmu.edu/~carlotta/teaching/INFS-795-s06/readings/Similarity_in_WordNet.pdf http://www.cs.utah.edu/~sidd/documents/msthesis03ppt.pdf www.iiia.csic.es/People/enric/AICom.html www.ai-cbr.org YILDIZ TEKNİK ÜNİVERSİTESİ BİLGİSAYAR MÜHENDİSLİĞİ BÖLÜMÜ

More Related