Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 6 Similarity Stand 20.12.00. - 2 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Recommended References.

Similar presentations


Presentation on theme: "Chapter 6 Similarity Stand 20.12.00. - 2 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Recommended References."— Presentation transcript:

1 Chapter 6 Similarity Stand 20.12.00

2 - 2 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Recommended References Stefan Wess (1995). Fallbasiertes Problemlösen in wissensbasierten Systemen zur Entscheidungsunterstützung und Dianostik. DISKI 126, infix-Verlag. Kapitel 6.2 (S. 43-68 und S. 124-132). Bergmann, R. & Stahl, S. (1998). Similarity Measures for Object-Oriented Case Representations. Proceedings of the European Workshop on Case-Based Reasoning, EWCBR'98. Althoff, K.-D, Richter, M. M. (1999).: Similarity and Utility in Non- Numerical Domains, Mathematische Methoden der Wirtschaftswissenschaften, Physika-Verlag, pp. 403 – 413. http://www.cbr-web.org/documents/RichterSimilarity99.pdf Richter, M. M. (1997).: A Note on Fuzzy Set Theory and Case Based Reasoning, Technical Report, International Computer Science Institute, University of California

3 - 3 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern The General Idea of Similarity (1) Similarity can be defined on any set U and it relates any two objects of U. The idea is when one is interested in some x  U and this x is not available (for whatever reason) then some y  U which is similar to x might do as well. That this is really the case needs of course a suitable definition of the specific notion of similarity used. This means: One has always to define the semantics of the similarity notion in use. This semantics has is always related to what the similarity is used for. Hence similarity is related to utility.

4 - 4 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern The General Idea of Similarity(2) Although similarity was first used in CBR to make use of previous experiences it applies to many more situations. The uses of applications of similarity often have little or nothing to do with the intuitive meaning of similarity !! Similarity is closely connected to search and retrieval: One starts a search for x and may end up with some “similar” y. This search is knowledge based and the knowledge is contained in the definition of the specific similarity notion.

5 - 5 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Similarity in E-C In E-C similarity enters the scenario always when inexact matching is involved. Therefore similarity will be defined between –products and products –functionalities and products –demands and products –demands and demands –functionalities and functionalities –customers and customers The purpose is always to replace the exact solution of some problem by some sufficiently good approximation.

6 - 6 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern The Intention of: Demand and Product are Similar (1) The basic intention: The product realizes the demand. The relation „Product P satisfies demand F“ is however not a yes-or-no relation but a more-or-less property. The notion of similarity is intended to represent the degree of satisfaction. The relation „Product P satisfies demand F“ requires additional knowledge which has to be represented in the similarity notion. The difficulty involved is there is a gap between demand and product in the descriptions (see chapter 9).

7 - 7 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern The Intention of: Demand and Product are Similar (2) The demands are driven by the utility of the customer. Hence customer prefers a product which is more useful. The similarity notion has at run time no access anymore to the users utility function and is therefore an a-priori approximation of the utility (see chapter 9). A consequence of similarity based offers: The customer obtains always an answer! (Because there is always a nearest neighbor...) Restriction: One can use the method of rough sets in order to describe acceptable and non-acceptable offers.

8 - 8 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Other Applications of Similarity in E-C The statement that two objects are similar is always followed by some action, e.g.: –some product may be replaced by a similar product –some product may realize a “similar” functionality –what was good for some demand may also be good to a similar demand –if a product realizes some functionality it may also realize a similar functionality –what was appropriate to some customer may also be appropriate to a similar customer In each situation the notion of being similar has to carry some knowledge about the intended actions.

9 - 9 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Similarity in CBR Purpose of similarity in CBR is analogue to the one in E-C: –Select cases that can be adapted easily to the current problem –Select cases that have (nearly) the same solution than the current problem Basic goal: similar problems have similar solutions Degree of similarity = utility / reusability of solution Similarity is an a-priori approximation of utility / reusability Goal of similarity modeling: provide a good approximation –close to real reusability –easy to compute

10 - 10 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Properties of Similarity (I) Observation 1: Similarity is not necessarily transitive. Example 1: +Kaiserslautern and Zürich are similar because both cities have (good) soccer teams. +Zürich and Basel are similar because both cities are located in Switzerland. -But: Kaiserslautern and Basel are not similar! Problem: Similarity between different aspects. ~

11 - 11 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Properties of Similarity (II) Observation 2: Similarity is not necessarily transitive. Example 2: +$ 10.- is similar to $ 12.- +$ 12.- is similar to $ 14.-...... +$ 1000.- is similar to $ 1002.- -But: $ 10.- is not similar to $ 1002.-! Problem: The property “low difference” is not a transitive notion. … ~

12 - 12 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Properties of Similarity (III) Observation 3: Similarity does not have to be symmetrical. Example: –“Peter is fighting like a lion.” With respect to certain properties (e.g., courage), Peter (as an element) is similar to a lion (as a prototype). –“A lion is fighting like Peter.” This is an untypical statement. Peter is not a prototype for courage. Problem: Similarity of one element to a prototype of a category is greater than vice versa. ~

13 - 13 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Possible Ways to Define Similarity Three ways to define similarity: i)binary similarity predicate: “x and y are similar” ii)binary dissimilarity predicate: “x and y are dissimilar” iii)similarity as an order relation: “x is at least as similar to y as to z” For simplicity we assume that all elements are taken from the same underlying set. Remarks: –i) and ii) are equivalent –iii) is more powerful in expressiveness: different degrees of similarity can be distinguished

14 - 14 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Similarity Relations (1) Aim: Definition of a relation R: R(x,y,z)  “x is at least as similar to y as x to z”. First step: Consider the relation S: S(x,y,u,v)  “x to y is at least as similar as u to v”. Definition of R: R(x,y,z) :  S(x,y,x,z) Possible requirements to the relation S: for all x,y,z,u,v,s,t holds: –S(x,x,u,v) every object is at least as similar to itself as two other arbitrary objects could be to each other (reflexivity) –S(x,y,u,v)  S(u,v,s,t)  S(x,y,s,t)transitivity –S(x,y,u,v)  S(y,x,u,v)  S(x,y,v,u)symmetry

15 - 15 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Similarity Relations (2) If one focuses on a fixed object x, (the current problem, the current demand): Look for: “y, which is most similar to x”  for all z holds: R(x,y,z) For a fixed x, we regard the relations:  x, > x, ~ x –y  x z  R(x,y,z) “y is at least as similar to x as to z” –y > x z  (y  x z)  z  x y) “y is more similar to x than to z” (strict part of  x ) –y ~ x z  (y  x z)  z  x y) “y and z are indistinguishable”

16 - 16 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Similarity Relations (3) For fixed x some y which satisfies y is most similar to x, i.e: for all z holds: R(x,y,z) is called a nearest neighbor of x. Notation : NN(x,y) A nearest neighbor is not necessarily uniquely defined, there may be several (indistinguishable) such elements. The nearest neighbor is the element which has to be approximated.

17 - 17 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Similarity Measures (1) In its most abstract form a measure is defined for two arguments taken from two arbitrary sets P (called queries) and S (called answers): A similarity measure is a mapping sim: P x S [0,1] (real interval) Major specializations are: (1) S is a subset of P: E.g. P = Description of all possible products, S = Description of all available products. (2) If there is a case base CB of cases (p,s) and P´ is the set of all p s.t. there is some (p,s)  CB then sim: P x P’ [0,1] This is the traditional setting in CBR (here P´ is the set of problems with solutions in CB).

18 - 18 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Similarity Measures (2) Idea: Numerical modeling of similarity (more or less similar) Along with ordinal information there is also a quantitative statement about the degree of similarity: Definition: A similarity measure on a set M is a real function sim: M 2  [0,1]. The following properties can hold: –  x  M: sim(x,x) = 1(Reflexivity) A similarity measure is symmetrical iff: –  x,y  M: sim(x,y) = sim(y,x)(Symmetry) Induced similarity relation: –sim(x,y)  sim(x,z)  “x is more similar to y than to z” 0 1 sim(x,y i ) y1y1 y2y2 y3y3 y4y4

19 - 19 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Distance Functions / Measures Instead of using similarity functions one often takes distance functions, the dual notion. Definition: A distance measure on a set M is a real valued function d: M 2  IR +. The following properties can hold: –  x  M d(x,x) = 0(Reflexivity) A distance measure is symmetrical iff: –  x, y  M d(x,y) = d(y,x)(Symmetry) A distance measure is a metric iff: –  x, y  M d(x,y) = 0  x = y –  x, y, z  M d(x,y) + d(y,z)  d(x,z)(Triangle Inequality) Induced similarity relation: –d(x,y)  d(x,z)  “x is more similar (less distant) to y than to z”

20 - 20 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Relation between Similarity and Distance Measures Definition: A similarity measure sim and a distance measure d are called compatible if and only if –  x, y, u, v  M S d (x,y,u,v)  S sim (x,y,u,v) (the same similarity relation is induced) Transformation of measures: If a bijective, order inverting mapping f: [0,1]  [0,1] exists with –f(0) = 1 –f(d(x,y)) = sim(x,y) then sim and d are compatible.

21 - 21 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Language Aspects If for the argument sets of sim we have P = S or S  P, then we can define the similarity function by referring to the same representation language for both arguments. If objects are defined in terms of attributes then one can first define measures on the domains of the attributes and then use some constructors in order to define the total similarity on the whole object. The measures on the domains of attributes are called local measures and measure for the total similarity is called the global measure. If the languages for P and S are very different then additional actions have to be taken, see chapter 9

22 - 22 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Some Simple Similarity Measures Representation language: Objects (Examples) are described by attribute-value pairs (feature vectors). At first: restriction to binary features. Regarding similarity between two objects x and y: x = (x 1,...,x n )x i  {0,1} y = (y 1,...,y n ) y i  {0,1}

23 - 23 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Hamming Distance Properties: –H(x,y)  [0,n] n is the maximum distance –H(x,y) is the number of distinguishing attribute values –H is a distance measure: H(x,x) = 0 H(x,y) = H(y,x) –H( (x 1,...,x n ), (y 1,....,y n ) ) = H( (1-x 1,...,1-x n ), (1-y 1,....,1-y n ) )

24 - 24 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Real-Valued Attributes Real-valued attributes x i, y i  IR for all i Generalization of the Hamming Distance to the City-Block-Metric: Alternative metrics Euclidean Distance: Weighted Euclidean Distance:

25 - 25 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Arbitrary Attribute Types Description by n attributes A 1,...,A n, each attribute A i has type T i. Local similarity: –one similarity function for each attribute: sim Ai (x i,y i ): T i x T i  [0..1] –local measures depend on the type of the attribute Global similarity: –sim(x,y)= sim( (x 1,..., x n ), (y 1,..., y n ) ) = F( sim A1 (x 1,y 1 ),..., sim An (x n,y n ) ) –F: [0..1] n  [0..1] is an amalgamation (or constructor) function –For F, usually we claim that F is monotonous in each argument F(0,...0) = 0 F(1,...,1) = 1 This will later be extended to a general local-global principle.

26 - 26 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Examples for F Weighted average: Generalization: Maximum: Minimum: k-Maximum: k-Minimum:

27 - 27 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern The General Local - Global Principle (1) Each object is described –from a global point of view –in a detailed view –Global measures are defined on the whole object –Local measures are defined on details, e.g. the domains of some attribute General idea: –The global view reflects the task and has a pragmatic character –The local details are of technical and domain character and task independent

28 - 28 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern The Local - Global Principle (2) The local measures should represent domain properties. Example: Water where temperature is an attribute with the domain e.g. T(water) = [-100, +200] In numerical domains as here: Landmarks are numbers which separate the real axis into intervals (temperature of water: 0 and 100 degrees). These landmarks are facts from physics and not personal relevances. Each interval is a qualitative region (where the material behaves in some sense very similar) The measure is not uniform: numbers inside a region have a high degree of similarity but numbers in different regions have low degree of similarity. The relevance of temperature for some problem is reflected by a weight.

29 - 29 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern The Local - Global Principle (3) The weights of the global measure (or more general: The amagalmation function) reflect –Importance –relevance –utility They depend on the pragmatics and are ultimately determined by the user. The local-global principle is a good guideline for defining measures for some application.

30 - 30 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern The Formal Local - Global Principle Each object A is constructed from so-called “parts” A i by some construction process C(A i |i  I) = A; where we C is the construction operator. Often the A i are also called the components. In an attribute-value representation the attributes are the components. The local-global principle for similarities now is stated in the following way: There are measures sim i on the possible values for the A i and some amalgamation function f such that sim(A, B) = f(sim i (A i, B i ) |i  I ) The sim i are local measures and sim is the global one.

31 - 31 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern The Monotonicity Axiom With the local-global principle a property of measures is connected called the monotonicity axiom: If sim(A, B) > sim(A, C) then there is at least one i  I such that sim i (A i, B i ) > sim i (A i, C i ). This axiom can be violated if the measure depends on certain relations between local attribute values. In such situations there may even be no measure with this properties. Hence the axiom is also a demand on the representation language. The purpose of introducing virtual attributes is usually to establish that this axiom holds.

32 - 32 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Similarities and Functional Dependencies (1) Attribute A is called functionally dependent from the attributes A 1,..., A n if the values of a can be computed by a function f from the values of the A 1,..., A n. The functional dependency may be conditional, i.e., it may only hold if certain other attributes have specific values. Functionally dependent attributes require special attention: –if two objects agree on the some attributes, they will also agree on any functional dependent attribute. –However, if they agree on a functionally dependent attribute, they do not necessarily agree on the base attributes.

33 - 33 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Similarities and Functional Dependencies (2) It is therefore an important task of knowledge acquisition to detect functional dependencies for the similarity computation. In addition, there maybe unknown virtual attributes on which the measure is easier to define, e.g., as a linear weighted sum. Example: Similarity depends on the difference of a1 and a2 rather than on a1 and a2 themselves, e.g., bank application: a1=income; a2=spending sim((a1,...,an),(b1,...,bn)) = sim’((a1-a2, a3,...,an),(b1-b2,b3,...,bn))

34 - 34 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Similarities and Unknown Values If some value is unknown in two objects C and D this should not contribute anything to the measure. If C is in the case base and its value is known, Q the query and the value is unknown then one of the choices could be taken: –default value –a value which contributes to the similarity a maximal –or a minimal amount

35 - 35 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Similarities and Redundant Values Redundant values are those which are known in the query and unknown in the answer from the case base. They can be handled in two ways: –Ignore them if it can be ensured that the case from the base have all values necessary for the solution. –For CBR: Omit the case C from the base and replace it by the query case D if C and D have different solutions. Even if C had provided a correct solution in the past it was only a good guess and the attribute value in the past was different from the value in D.

36 - 36 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Further Measures: Local Similarity Measures for Unordered Symbols Similarity table: sim A (x,y) = s[x,y] Symbol type T A ={v 1,...,v k } For reflexive similarity measures: diagonal entries = 1 For symmetric similarity measures: upper triangle matrix = lower triangle matrix

37 - 37 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Local Similarity Measures for Integer/Real Similarity often based on difference: –linearly scaled value ranges: sim A (x,y) = f(x-y) –exponentially scaled value ranges: sim A (x,y) = f(log(x)-log(y)) Generally, for f we claim: –f:  IR  [0..1] or Z  [0..1] –f(0) = 1 (Reflexivity) –f(x): monotonously decreasing for x>0 and monotonously increasing for x<0 –Examples: 1 f symmetric 1 f asymmetric x: query; y: case query is minimum demand asymmetric x: query; y: case query is maximum demand 1 f

38 - 38 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Similarity Characterization Goal: Find general properties of the similarity measures for every simple attribute of the domain model.  local similarity measures Basic Properties: –Symmetry: symmetric vs. asymmetric –Exact match preference –Continuous vs. sudden decrease –Kind of decrease

39 - 39 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Property : Symmetry Symmetric: –if it is not important for the similarity computation which attribute value belongs to the query and which one belongs to the case –Example: for numeric values (INTEGER, REAL) use the absolute distance d = |query value - case value|  sim = f(d) with f:[IR + ]  [0;1] Asymmetric: –if it is important which value belongs to the query and which one belongs to the case –similarity can be computed with two different similarity functions: d = (query value - case value)

40 - 40 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Property: Exact Match Preference Often it can be useful to weight the exact match of the query and the case attribute value much higher than an inexact match  define a maximal possible similarity sim max < 1 Example for a numeric attribute sim d 1 max sim a linear similarity function d = |query value - case value|

41 - 41 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Property: Continuous or Sudden Decrease Depending on the distance between two values, distinguish between decrease –at a point(  Example a)) –in an interval(  Example b)) Example: a) decrease of the whole similarity at the distance X b) decrease in the interval [x min ;x max ] sim d Xx maxmin x a) b)

42 - 42 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Property: Kind of Decrease Different forms: –linear: There is a linear relationship between the distance and the similarity of two values. –downward convexity: A small difference between two values causes a big decrease of similarity. –upward convexity: A small difference between two values causes only a small decrease of similarity. –combined sim d linear upward convexity downward convexity sim d upward convexity downward convexity

43 - 43 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Symmetric Similarity Measures for Numeric Attributes (I) Step-Function: If there is only the possibility that an attribute-value of a case c is useful or not useful with respect to the query-attribute- value q: d(q,c) sim(q,c) 1 S

44 - 44 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Symmetric Similarity Measures for Numeric Attributes (II) Linear Function: The idea is that the similarity increases linearly in an interval with the decrease of distance between the two values. –The begin of the interval is a user-defined distance min  0. –The end of the interval can be the greatest possible value for the actual attribute (which we call Max) or it can be a user-defined distance max < Max. d(q,c) sim(q,c) 1 minmax

45 - 45 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Symmetric Similarity Measures for Numeric Attributes (III) Asymptotic Function: Small differences between the two values cause a big decrease of similarity. sim d(q,c) 1 a 3 2 a 1 a 1 a 2 a a 3 < < The parameter a influences the gradient of the function

46 - 46 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Symmetric Similarity Measures for Numeric Attributes (IV) S-Function: If we tolerate differences between the two values even to a defined distance x 1 we can use the following similarity function: sim d(q,c) 1 0,9 0,1 x1x1 x2x2

47 - 47 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Local Similarity Measures for Ordered Symbols For ordered symbols, an order is given in addition to the value range. Example: qualitative values: {small, medium, large} small < medium < large Local similarity measures like for numeric types. Therefore: Define an Integer value for each symbol so that the order is kept. Example: –small  1 –medium  2 –large  3

48 - 48 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Local Similarities for Taxonomies (I) Assumption: considered objects can be ordered in a Taxonomy or set of notions (tree or graph structure) Example: The ELSA 2000 is more similar to the Stealth 3D than to one of the S3 Trio adapters or MGA adapters.

49 - 49 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Local Similarities for Taxonomies (II) Definition of similarity for leaf nodes: –assignment of a similarity value to each inner node –similarity values for successor nodes become larger –similarity between two leaf nodes is computed by the similarity value at the deepest common predecessor Example: sim (ELSA 2000, Stealth 3D) = 0,7 sim (ELSA 2000, VGA V64) = 0,5 sim (ELSA 2000, Matrox Mill.) = 0,2 0.7 0.9 0.5 0.8 0.2

50 - 50 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Similarities for Taxonomies (III) Examples Example 1: Product Search A customer wants a computer system with a S3 graphics adapter. Which one (model) does not matter to the customer.   current problem: graphics adapter: S3_Graphics_Card Example 2: After Sales Support - Diagnosis system for PCs. An error case holds for all S3 graphics adapters.   (generalised) case: graphics adapter: S3_Graphics_Card Example 3: After Sales Support - Diagnosis system for PCs. The user has a S3 graphics adapter, but which one is not known.   current problem: graphics adapter: S3_Graphics_Card

51 - 51 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Local Similarities for Taxonomies (IV) Similarity of Inner Nodes Semantics of inner nodes: –Inner node stands for the set of the underlying leaf nodes Example: S3 Virge = {ELSA 2000, Stealth 3D} –Semantics of inner nodes (sets) in a case and in the current problem can be: unknown: an element of the set exists, but it is not known. arbitrary: it does not matter, which element of the set is considered. –Semantics of inner nodes determines the way to calculate similarity

52 - 52 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Local Similarities for Taxonomies (V) Semantics of Inner Nodes: “Arbitrary”(1) Inner node occurs in case: Inner node occurs in problem (query):

53 - 53 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Local Similarities for Taxonomies (V) Semantics of Inner Nodes: “Arbitrary” (2) Inner node occurs in case and problem: 0.7 0.9 0.5 0.8 0.2 Notation: L Q, L C :Leaf node after inner node Q, C C < Q:C lies under Q in taxonomy (C is successor of Q) S :Similarity value of the common predecessor node of Q and C

54 - 54 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Local Similarities for Taxonomies (VI) Semantics of Inner Nodes: “Unknown” Uncertainty can be interpreted in different ways: –optimistic strategy: presume the highest similarity, which is still possible. –pessimistic strategy: presume the lowest similarity, which is still possible. –strategy of the expected value: presume the expected value for the similarity based on known information.

55 - 55 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Pessimistic Strategy: –inner node (uncertainty) occurs in case: –inner node (uncertainty) occurs in problem (query): –inner node (uncertainty) occurs in case and in problem: Local Similarities for Taxonomies (VII) Semantics of Inner Nodes: “Unknown” 0.7 0.9 0.5 0.8 0.2

56 - 56 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Object-Oriented Representation Extension of the similarity calculation for attribute-value pairs Regard objects as attribute-value pairs Similarity becomes a property of the object class –slot level (comparison of single attribute values): local similarity measures sim i (v i,w i ) –class level (comparison of objects): determination of object similarity by amalgamation (e.g., weighted sum) of the local similarities of typed slots object similarity of sub-objects in relational slots

57 - 57 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Basic Approach to Similarity Computation (cf. Wess, 1995) Bottom-up computation of similarity Local similarity measures for typed attributes Object similarity measures by aggregation (e.g., average) –results from local similarity measures –results from object similarity measures from related objects Computation

58 - 58 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Example Object instance: Lanzarote (Object class: Journey) Location: Lanzarote Duration: 14 Accommodation: Hotel_Playa Sports facilities: Tennis Object instance: Hotel_Playa (Object class: Hotel) Category: 3-Stars Distance_to_Beach: medium Object instance: Tennis (Object class: Sports) Equipment: good Price_per_hour: 15,50 Case 0.7 Object instance: Dream_Journey (Object class: Journey) Location: Tenerife Duration: 10 Accommodation: Dream_Hotel Sports facilities: Dream_Sports Object instance: Dream_Hotel (Object class: Hotel) Category: 2-Stars Distance_to_Beach: short Object instance: Tennis (Object class: Sports) Equipment: very good Price_per_hour: 20,00 Query (Current Problem) 0.5 0.2 0.1 0.5 0.8 0.2 Weights 0.8 0.7 0.75 0.8 1 1 0.5 0.96 0.75 0.96 0.786

59 - 59 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Problems of Similarity for OO Cases OO cases to be compared may have different structure Instances from different classes must be compared –e.g., a CD-Writer and a Hard Disk Instances of classes from different abstraction levels of the class hierarchy have to be compared –e.g., a CD-Writer and a Magnetic Storage Device

60 - 60 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Example 1a: Sales Support for PCs Cases: Available PCs from stock Query: Customer’s requirements C1C1 C2C2 Q C 2 is more similar to Q than C 1 because C 2 and Q are both optical storage devices (CD-Media) Storage Device manufacturer: Symbol capacity: Real access time: Real Optical Storage Dev. read-speed: Integer type-of-laser: Symbol Magnetic Storage Device build-in-size: {3.5 ; 5.25} type-of-magnetic-surface: Symbol Streamer Floppy DiskHard Disk CD-ROM CD-WriterCD-RW Writeable O. S. D. write-speed: Integer optional storage:

61 - 61 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Example 1b: Sales Support for PCs C 2 is perfectly suited: –C 2 is more similar to Q than C 1 –sim(C 2,Q)=1sim(C 1,Q)<1 Different Query: Customer wants a PC with an Optical Storage Device He does not care which one. Storage Device manufacturer: Symbol capacity: Real access time: Real Optical Storage Dev. read-speed: Integer type-of-laser: Symbol Magnetic Storage Device build-in-size: {3.5 ; 5.25} type-of-magnetic-surface: Symbol Streamer Floppy DiskHard Disk CD-ROM CD-WriterCD-RW Writeable O. S. D. write-speed: Integer optional storage: C1C1 C2C2 Q

62 - 62 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Example 2a: PC Trouble-Shooting C 1 is perfectly suited: –C 1 is more similar to Q than C 2 –sim (C 1,Q)=1 sim(C 2,Q)<1 Case: Previous diagnostic situations (fault descriptions) Query: Observed symptoms for current problem Storage Device manufacturer: Symbol capacity: Real access time: Real Optical Storage Dev. read-speed: Integer type-of-laser: Symbol Magnetic Storage Device build-in-size: {3.5 ; 5.25} type-of-magnetic-surface: Symbol Streamer Floppy DiskHard Disk CD-ROM CD-WriterCD-RW Writeable O. S. D. write-speed: Integer optional storage: C1C1 C2C2 Q Fault occurs with every Optical Storage Device

63 - 63 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Example 2b: PC Trouble-Shooting C 1 is perfectly suited: –C 1 is more similar to Q than C 2 –sim(C 1,Q)= 1 BUT sim(C 2,Q)< 1 Storage Device manufacturer: Symbol capacity: Real access time: Real Optical Storage Dev. read-speed: Integer type-of-laser: Symbol Magnetic Storage Device build-in-size: {3.5 ; 5.25} type-of-magnetic-surface: Symbol Streamer Floppy DiskHard Disk CD-ROM CD-WriterCD-RW Writeable O. S. D. write-speed: Integer optional storage: C1C1 C2C2 Q User only knows that he has a writeable OSD but doesn’t know what kind

64 - 64 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Framework for Object Similarities Intra-class similarity –compute the similarity of two objects based on the shared attributes of the most specific parent class –apply standard approach: aggregation of local similarity measures Inter-class similarity –compute the similarity of the object classes (taxonomy approach!) –represents the highest possible similarity that can be achieved Combined to object similarity: Aggregation function Local Similarity Class of Query Object Class of Case Object

65 - 65 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Semantics of Objects A class at a leaf node of the hierarchy represents a set of concrete objects, described in a particular way: –e.g., class Hard Disk represents concrete objects, namely particular hard disks A class at an inner node of the hierarchy represents a set of abstract objects, described in a particular way: –e.g., instances of class Optical Storage Device are not concrete objects Abstract objects are sets of concrete objects: –e.g., Optical Storage Device is an abbreviation for the set of all instances from the subclasses CD-ROM, CD-Writer, CD-RW.

66 - 66 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Semantics of Abstract Objects What is the semantics of optional storage: ? Different semantics in the three examples 1b, 2a, 2b: –any value in the query: Looking for a case that has an arbitrary object from the set in the respective attribute Example 1b: User is looking for a PC with an optical storage device –any value in the case: The case is valid for all objects from the set Example 2a: Fault occurs with every optical storage device –uncertainty: The case (or query) is valid for one object from the set, but we don’t know for which one Example 2b: User just knows that he has a writeable optical storage device but doesn’t know which one

67 - 67 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Example Object class Apartment Superclass Accommodation Rooms: Integer Kitchen: {yes, no} Object class Hotel Superclass Accommodation Food: Symbol Balcony: Boolean Similarity Value: 0.6 Semantic: “arbitrary” sim*(o 1,o 2 )sim Hotel Apartment0.6sim Accommodation HotelHotel1sim Hotel HotelAccommodation 1sim Accommodation ApartmentAccommodation 1sim Accommodation AccommodationHotel1sim Accommodation ProductQuery Situation of Comparison Used Similarity Measure Object class Accommodation Ort: Taxonomy_of_Regions Price: Real Close_to_Sea: Symbol

68 - 68 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Suppose (P 1, S 1 ) and (P 2, S 2 ) are two pairs (problem, solution). Guiding principle:If sim(P, P 1 )  sim(P, P 2 ) then one would not prefer S 2 over S 1 as a solution for P. In particular: Nothing is preferred over a nearest neighbor. Ordinal aspect: Preference order (partial) Cardinal aspect: Meaning of numbers Semantics of Similarity: Similarity Measures and Preferences

69 - 69 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Preference Relations and Utility Functions Both concepts come from economics (v. Neuman-Morgenstern Theory) A preference relation over a universe U is just a binary relation  where: –a  b means that a preferred over b in a choice situation A utility function is a mapping u: U  IR: –u realizes the preference relation  if u(a)  u(b) iff a is preferred over b The utility function adds a cardinality aspect to the relation aspect of the preference, i.e., one can say how useful the choice is.

70 - 70 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Semantics of Similarity (III): Utility The similarity measure should reflect the utility function ! Problem P Problem P1 Solution S Solution S1 Utility for P: good Utility for P1 ? similar Copy, adapt

71 - 71 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Humans are better in estimating - Relations rather then - numerical values Consequence: Weakening of utility = similarity to They have the same monotonicity behavior Comparing Similarity and Utility

72 - 72 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Given: An actual problem Q. Define for cases (P,S)  CB: f sim,Q (S) := sim(P,Q) Now can be compared with a utility function because both are real valued functions defined on solutions. If the similarity function compares directly “demand and product” or “functionality and product” then similarity and utility can be directly compared. Formal Comparison

73 - 73 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Ideal situation: The similarity measure coincides exactly with the intended utility function. A weaker demand: The utility function u and the function f sim,Q are similarly ordered. Definition: Two functions f,g : X -> R are similarly ordered if D(f, g, x, y) : = (f(x) - f(y))*(g(x) - g(y))  0 for any x,y  X Semantic Comparison

74 - 74 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Approach: Use the correspondence Similarities --- Utilities for the building process over various stages local --- global This can be used top-down as well as bottom-up. Similarities and Utilities (1)

75 - 75 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Basic ideas: 1) Use a language which describes similarities as well as utilities 2) Do it in such a way that local similarities correspond to preferences global similarities correspond to utility functions 3) Take advantage of the well established methods for building similarity measures 4) In particular, use the local - global view by applying the same constructors for obtaining the global objects from the local ones in both situations. Similarities and Utilities (2)

76 - 76 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Properties of Similarity Revisited The utility interpretation of similarity throws a new light on the properties of similarity. We consider two cases (P,S) and (P’,S’). Symmetry of sim: sim(P,P’) = sim(P’,P) would mean S’ is as useful for P as S for P’. This is obviously not always the case. Reflexivity sim(P,P) = 1 would mean: The solution S is at least as good for P than any other solution. This is a demand on the case base not satisfied if non- optimal solutions are stored.

77 - 77 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Sensitivity Analysis Utility (and quality) functions u depend in general on several parameters in different ways. Sensitivity analysis asks for the dependency of u from the arguments: –When do small changes in an argument result in a big change of u? Main problem: The arguments are not independent in the sense that certain combinations are responsible for the changes of the values of u. For this purpose one needs to –decompose the preference relations (top-down) –define certain new (virtual) attributes (bottom-up).

78 - 78 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Informal Utilities A problem with utilities and preferences is that they are often informally stated. First problem: When is a formal utility function equivalent to the informal one? This cannot be proven but established by a Turing test. Second problem: How to obtain a practicable formal analogue of the informal utility? This will be done by decomposition techniques.

79 - 79 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Informal - Formal : The Ordering Principle A Turing test How to compare a formal and an informal concept ? Use orderings ! Suppose there is an ordering < with the concept C associated: Informal human version of C Formal version of C < two versions: formal and informal The goal is that when variations of the arguments of < are presented: The human says „up“ if and only if the formal system says „up“ goal

80 - 80 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern preferences, quality aspects Decomposition of user preferences until measurable quantities are obtained. Decomposition : Preferences

81 - 81 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Complex Preference Relation Decompose preference relation meet ·· · · · · · · Virtual attribute Use Sensitivity Analysis Primary attributes Bridge the Gap Goal: Similarly Ordered · · ·

82 - 82 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Example (1): Decomposition Quality scope of applicability resistance against heat nice appearance Can be measured Product built from material m1,...,m8

83 - 83 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Example (2) Virtual Attributes a=% of material2 b=% of material4c =% of material6 material code: a (b + c) virtual attribute Product built from material m1,...,m8

84 - 84 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Example (3): Bridge the Gap heat resistance material code heat_resistance (product) and material_code(product) are similarly ordered Product built from material m1,...,m8

85 - 85 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Similarity and Fuzzy-Sets Fuzzy subsets of A of U are denoted by A  f U µ A is the membership function of A. A fuzzy partition of U into n fuzzy subsets is given by membership functions µ 1 (x),...,µ n (x) such that  (µ i | 1  i  n) = 1 A fuzzy classifier for such a partition is mapping c f : U  [0, 1] n such that for c f (x) = (µ 1 (x),..., µ n (x)) we have  (µ i (x) | 1  i  n) = 1.

86 - 86 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern From Similarities to Fuzzy Sets A similarity measure sim on U defines a fuzzy subset SIM  f V: = U x U by µ SIM (x 1, x 2 ): = sim (x 1, x 2 ) We associate to each x  U a fuzzy subset F x  f U by µ x (y) = sim(x,y) µ x (y) = sim (x,y) and symmetry of sim imply µ x (y) = µ y (x) So we obtain from sim for each x some fuzzy subset which can be regarded as how U is structured by sim from the viewpoint of x. The nearest neighbor relation now reads as NN (x, y)  µ x (y)  µ x (z),  z  CB, or equivalently NN (x, y)  µ SIM (x, y)  µ SIM (x, z),  z  CB

87 - 87 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern From Fuzzy Sets to Similarities (1) Suppose we have a fuzzy subset S  f V = U x U with µ s (x, x) = 1 then S defines obviously a similarity measure. If we have simply a fuzzy set K  f U then we would need in addition a reference object (a prototype) in order to define a measure. Such a reference object has to satisfy µ K (x) = 1. In this case we can define a similarity measure by sim(x, y) = µ K (y)

88 - 88 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern From Fuzzy Sets to Similarities (2) Suppose there is a subset CB  U such that for each x  CB we have some fuzzy subset K x  f U with membership functions µ x (y), for which µ x (x) = 1 holds. Then we can again define a measure on U x CB by sim(x, y) = µ x (y) for y  U, x  CB. This is sufficient to define the nearest neighbor notion NN(y, x), y  U, x  CB.

89 - 89 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Summary The similarity concept is the most important concept in inexact matching and reasoning. Similarity is closely related to utility. Similarity can be defined by relations or measures. There are different ways to define measures and they can have several properties. These properties are dependent by the intended use. A basic building principle is the local-global principle. Similarity measures can be regarded as fuzzy relations.


Download ppt "Chapter 6 Similarity Stand 20.12.00. - 2 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern Recommended References."

Similar presentations


Ads by Google