Package CHEM :: Package Kernel :: Module MisMatch :: Class MisMatch
[hide private]
[frames] | no frames]

Class MisMatch



BaseKernel.BaseKernel --+
                        |
                       MisMatch

Instance Methods [hide private]
 
__init__(self, k, a)
a[] is an array of size k.
 
similarity(self, s1, s2)
Primary abstract method where, given two objects, should return an appropriate, non-negative, similarity score between the two.
 
buildFeatureDictionary(self, s)
Optional abstract method.

Inherited from BaseKernel.BaseKernel: dictionaryDotProduct, dictionaryEuclideanDistanceSquared, ensureListCapacity, getFeatureDictionary, normalizeFeatureDictionary, outputMatrix, prepareFeatureDictionaryList

Class Variables [hide private]

Inherited from BaseKernel.BaseKernel: featureDictList, objIndex1, objIndex2

Method Details [hide private]

__init__(self, k, a)
(Constructor)

 
a[] is an array of size k. a[n] is the score if there are n matches.

similarity(self, s1, s2)

 
Primary abstract method where, given two objects, should return an appropriate, non-negative, similarity score between the two. Up to the implementing class to define what this is.
Overrides: BaseKernel.BaseKernel.similarity
(inherited documentation)

buildFeatureDictionary(self, s)

 

Optional abstract method. Given some object to compare, build a dictionary of its important features such that it is easy to compare any two objects' feature dictionaries.

Combined with the getFeatureDictionary(...) and prepareFeatureDictionaryList(...) methods, this can save a lot of time as the features need only be calculated once for an object, then stored in self.featureDictList instead of being recalculated for every similarity call.
Overrides: BaseKernel.BaseKernel.buildFeatureDictionary
(inherited documentation)