View
218
Download
2
Embed Size (px)
Citation preview
- 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 - (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 - (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 - (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 - (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 - (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 - (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 - (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 - (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 - (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 - (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 - (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 - (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 - (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) zx y)
“y is more similar to x than to z” (strict part of x )
– y ~x z (y x z) zx y)
“y and z are indistinguishable”
- 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 - (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 - (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: M2 [0,1]. The following properties can hold:– x M: sim(x,x) = 1 (Reflexivity)
A similarity measure is symmetrical iff:– x,yM: 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 1sim(x,yi)
y1y2y3y4
- 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: M2 IR+.
• The following properties can hold:
– xM d(x,x) = 0 (Reflexivity)
A distance measure is symmetrical iff:
– x, yM d(x,y) = d(y,x) (Symmetry)
A distance measure is a metric iff:
– x, yM d(x,y) = 0 x = y
– x, y, zM 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 - (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, vM Sd(x,y,u,v) Ssim(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 - (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 - (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 = (x1,...,xn) xi {0,1}
y = (y1,...,yn) yi {0,1}
- 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( (x1,...,xn), (y1,....,yn) ) = H( (1-x1,...,1-xn), (1-y1,....,1-yn) )
H x y n x y x yi ii
n
i ii
n( , ) ( ) ( )
1 11 1
- 24 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern
Real-Valued Attributes
• Real-valued attributes xi , yi IR for all i
• Generalization of the Hamming Distance to the
City-Block-Metric:
• Alternative metrics
Euclidean Distance:
Weighted Euclidean Distance:
d x y x yi i
i
n
( , ) | |
1
d x y x yi i
i
n
( , ) ( ) 2
1
d x y x yi i i
i
n
( , ) ( ) 2
1
- 25 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern
Arbitrary Attribute Types
• Description by n attributes A1,...,An, each attribute Ai has type Ti.
• Local similarity:
– one similarity function for each attribute: simAi(xi,yi): Ti x Ti [0..1]
– local measures depend on the type of the attribute
• Global similarity:
– sim(x,y)= sim( (x1, ..., xn), (y1, ..., yn) )
= F( simA1(x1,y1),..., simAn(xn,yn) )
– 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 - (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:
1 with ),...,(11
1
n
ii
n
iiin wswssF
1 and with )(),...,(11
1
n
ii
n
iiin wswssF IR
F s s s xn n( ,..., ) max{ ,..., }1 1
F s s s xn n( ,..., ) min{ ,..., }1 1
niiikin ssssssF ... with ),...,( 211
niiikin ssssssF ... with ),...,( 211
- 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 - (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 - (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 - (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” Ai by some
construction process
• C(Ai |i I) = A;
• where we C is the construction operator. Often the Ai 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 simi on the possible values for the Ai and some amalgamation function f such that
sim(A, B) = f(simi(Ai , Bi) |i I )
• The simi are local measures and sim is the global one.
- 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 simi(Ai , Bi) > simi(Ai , Ci).
• 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 - (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 A1,..., An if the values of a can be computed by a function f from the values of the A1,..., An. 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 - (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 - (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 - (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 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern
Further Measures: Local Similarity Measures for Unordered Symbols
• Similarity table: simA(x,y) = s[x,y]
• Symbol type TA={v1,...,vk}
• For reflexive similarity measures: diagonal entries = 1• For symmetric similarity measures:
upper triangle matrix = lower triangle matrix
s[x,y] v1 v2 ... vk
v1 s[1,1] s[1,2] s[1,k]
v2 s[2,1] s[2,2] s[2,k]
...
vk s[k,1] s[k,2] s[k,k]
- 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: simA(x,y) = f(x-y)
– exponentially scaled value ranges: simA(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
1f
asymmetricx: query; y: case
query is minimum demand
asymmetricx: query; y: case
query is maximum demand
1
f
- 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 - (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)
]1;0[][2
]1;0[][1 with
0 )(2
0 1
0 )(1
IRf
IRf
dif df
dif
difdf
sim
- 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 simmax < 1
• Example for a numeric attribute
sim
d
1
maxsim
a linear similarity function
d = |query value - case value|
- 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 [xmin;xmax]
sim
dX xmaxmin
x
a)
b)
- 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
upwardconvexity
downwardconvexity
- 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:
q-cd(q,c)else
Scqdifcqsim
with 0
),( 1),(
d(q,c)
sim(q,c)
1
S
- 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.
maxmin0
;with
max),(
max),(min
min),(
0minmax
),(max1
),(Max
q-cd(q,c)
cqdif
cqdif
cqdifcqdcqsim
d(q,c)
sim(q,c)
1
min max
- 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.
IRaacqdsim
with ),(exp
sim
d(q,c)
1
a3
2a
1a 1
a2
a a3
< <
The parameter a influences the gradient of the function
- 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 x1 we can use the following similarity function:
IRaaxsim
with 3exp
sim
d(q,c)
10,9
0,1
x1 x2
- 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 - (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.
Graphics Card
S3 Graphics Card MGA Graphics Card
ELSA 2000 Stealth 3D200 Miro Video
Matrox Mill. 220 Matrox Mystique220
VGA V64
S3 Virge Card S3 Trio Card
- 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
Graphics Card
S3 Graphics Card MGA Graphics Card
ELSA 2000 Stealth 3D200 Miro Video
Matrox Mill. 220 Matrox Mystique220
VGA V64
S3 Virge Card S3 Trio Card0.7 0.9
0.5 0.8
0.2
- 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 - (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 - (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):
otherwise
if 1}|),(max{),(
,CqC S
CqLccqsimCqSIM
SIM Q c sim q c q Lc Q
SQQ c
( , ) max{ ( , )| },
1 if
otherwise
- 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:
SIM Q C sim q c q L c LC Q Q C
SQ CQ C
( , ) max{ ( , )| , },
1 if or
otherwise
Graphics Card
S3 Graphics Card MGA Graphics Card
ELSA 2000 Stealth 3D200 Miro Video
Matrox Mill. 220 Matrox Mystique220
VGA V64
S3 Virge Card S3 Trio Card0.7 0.9
0.5 0.8
0.2 Notation:LQ, LC: Leaf node after inner node Q, C
C < Q: C lies under Q in taxonomy (C is successor of Q)
S<Q,C>: Similarity value of the common predecessor node of Q and C
- 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 - (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”
}|),(min{),( ,CqC SLccqsimCqSIM
SIM Q c sim q c q L SQ Q c( , ) min{ ( , )| } ,
SIM Q C sim q c c L q L Sc Q Q C( , ) min{ ( , )| , } , Graphics Card
S3 Graphics Card MGA Graphics Card
ELSA 2000 Stealth 3D200 Miro Video
Matrox Mill. 220 Matrox Mystique220
VGA V64
S3 Virge Card S3 Trio Card0.7 0.9
0.5 0.8
0.2
- 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 simi(vi,wi)
– 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 - (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
Co
mp
utatio
n
- 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-StarsDistance_to_Beach: medium
Object instance: Tennis(Object class: Sports)
Equipment: goodPrice_per_hour: 15,50
Case0.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-StarsDistance_to_Beach: short
Object instance: Tennis(Object class: Sports)
Equipment: very goodPrice_per_hour: 20,00
Query (Current Problem)
0.50.20.20.1
0.50.5
0.80.2
Wei
ghts
0.8
0.7
0.75
0.81
10.5
0.96
0.75
0.96
0.786
- 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 - (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
C1 C2
Q
C2 is more similar to Q than C1 because C2 and Q are both optical storage devices (CD-Media)
Storage Devicemanufacturer: Symbolcapacity: Realaccess time: Real
Optical Storage Dev.read-speed: Integertype-of-laser: Symbol
Magnetic Storage Devicebuild-in-size: {3.5 ; 5.25}type-of-magnetic-surface: Symbol
Streamer Floppy Disk Hard Disk
CD-ROM
CD-Writer CD-RW
Writeable O. S. D.write-speed: Integer
optional storage:
- 61 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern
Example 1b: Sales Support for PCs
C2 is perfectly suited:
– C2 is more similar to Q than C1
– sim(C2,Q)=1 sim(C1,Q)<1
• Different Query: Customer wants a PC with an Optical Storage Device He does not care which one.
Storage Devicemanufacturer: Symbolcapacity: Realaccess time: Real
Optical Storage Dev.read-speed: Integertype-of-laser: Symbol
Magnetic Storage Devicebuild-in-size: {3.5 ; 5.25}type-of-magnetic-surface: Symbol
Streamer Floppy Disk Hard Disk
CD-ROM
CD-Writer CD-RW
Writeable O. S. D.write-speed: Integer
optional storage:
C1 C2
Q
- 62 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern
Example 2a: PC Trouble-Shooting
C1 is perfectly suited:
– C1 is more similar to Q than C2
– sim (C1,Q)=1 sim(C2,Q)<1
• Case: Previous diagnostic situations (fault descriptions)
• Query: Observed symptoms for current problem
Storage Devicemanufacturer: Symbolcapacity: Realaccess time: Real
Optical Storage Dev.read-speed: Integertype-of-laser: Symbol
Magnetic Storage Devicebuild-in-size: {3.5 ; 5.25}type-of-magnetic-surface: Symbol
Streamer Floppy Disk Hard Disk
CD-ROM
CD-Writer CD-RW
Writeable O. S. D.write-speed: Integer
optional storage:
C1
C2
Q
Fault occurs with every Optical Storage Device
- 63 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern
Example 2b: PC Trouble-Shooting
C1 is perfectly suited:
– C1 is more similar to Q than C2
– sim(C1,Q)= 1 BUT sim(C2,Q)< 1
Storage Devicemanufacturer: Symbolcapacity: Realaccess time: Real
Optical Storage Dev.read-speed: Integertype-of-laser: Symbol
Magnetic Storage Devicebuild-in-size: {3.5 ; 5.25}type-of-magnetic-surface: Symbol
Streamer Floppy Disk Hard Disk
CD-ROM
CD-Writer CD-RW
Writeable O. S. D.write-speed: Integer
optional storage:
C1
C2
Q
User only knows that he has a writeable OSD
but doesn’t know what kind
- 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:
)).,.(),...,.,.((),(intra nAAAAA AcqsimcqsimcqSIMnn111
Aggregation function Local Similarity
),(inter CQSIM
Class of Query Object Class of Case Object
),())(),((),( intrainter cqSIMcclassqclassSIMcqsim
- 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 - (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: <instance of Optical Storage Device> ?
• 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 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern
Example
Object class ApartmentSuperclass Accommodation
Rooms: IntegerKitchen: {yes, no}
Object class HotelSuperclass Accommodation
Food: SymbolBalcony: Boolean
Similarity Value: 0.6Semantic: “arbitrary”
sim*(o1,o2) sim<class(o1),class(o2)>
Hotel Apartment 0.6 simAccommodation
Hotel Hotel 1 simHotel
Hotel Accommodation 1 simAccommodation
Apartment Accommodation 1 simAccommodation
Accommodation Hotel 1 simAccommodation
Product Query
Situation of Comparison Used Similarity Measure
Object class AccommodationOrt: Taxonomy_of_RegionsPrice: RealClose_to_Sea: Symbol
- 68 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern
• Suppose (P1, S1) and (P2, S2) are two pairs (problem, solution).
• Guiding principle:If sim(P, P1) sim(P, P2) then one would not prefer S2 over S1 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 - (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 - (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 !
ProblemP
ProblemP1
SolutionS
SolutionS1
Utilityfor P: good
Utilityfor P1 ?
similar Copy,adapt
- 71 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern
• Humans are better in estimating - Relationsrather then- numerical values
• Consequence: Weakening ofutility = similaritytoThey have the same monotonicity behavior
Comparing Similarity and Utility
- 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: fsim,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 - (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 fsim,Q are similarly ordered.
• Definition:Two functions f,g : X -> R are similarly ordered ifD(f, g, x, y) : = (f(x) - f(y))*(g(x) - g(y)) 0 for any x,y X
Semantic Comparison
- 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 - (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 - (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 - (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 - (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 - (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 humanversion of C
Formalversion
of C
< two versions: formal and informalThe goal is that whenvariations of the arguments of < are presented:The human says „up“if and only if the formalsystem says „up“
goal
- 80 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern
preferences,quality aspects
Decomposition of user preferences until measurable quantitiesare obtained.
Decomposition : Preferences
- 81 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern
Complex Preference Relation
Decomposepreference relation
meet
··
· ·
·
· · ·
Virtual attributeUse SensitivityAnalysis
Primary attributes
Bridge the Gap
Goal: Similarly Ordered
· · ·
- 82 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern
Example (1): Decomposition
Quality
scope of applicability
resistanceagainst heat
nice appearance
Can bemeasured
• Product built from material m1, ...,m8
- 83 - (c) 2000 Dr. Ralph Bergmann and Prof. Dr. Michael M. Richter, Universität Kaiserslautern
Example (2) Virtual Attributes
a=% of material2 b=% of material4 c =% of material6
material code:a (b + c)
virtualattribute
• Product built from material m1, ...,m8
- 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 - (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 | 1in) = 1
• A fuzzy classifier for such a partition is mapping
cf: U [0, 1]n
such that for
cf(x) = (µ1(x),..., µn(x)) we have (µi(x) | 1in) = 1.
- 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 (x1, x2): = sim (x1, x2)
•We associate to each x U a fuzzy subset Fx 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 beregarded as how U is structured by sim from the viewpoint of x.
•The nearest neighbor relation now reads asNN (x, y) µx (y) µx (z), z CB,
or equivalently
NN (x, y) µSIM (x, y) µSIM (x, z), z CB
- 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 subsetS 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 bysim(x, y) = µK (y)
- 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 Kx 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 - (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.