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

Class VariantAggregateSpectrumKernel



BaseKernel.BaseKernel --+
                        |
                       VariantAggregateSpectrumKernel

Enhancement of AggregateSpectrumKernel. Do everything that AggregateSpectrumKernel does, but rather than just analyzing the supplied SMILES strings, parse the SMILES strings into molecule objects and generate several variant, but equivalent SMILES strings. Then apply the AggregateSpectrumKernel on all of those variants collectively.

Instance Methods [hide private]
 
__init__(self, weightFactor=1)
Constructor.
 
similarity(self, obj1, obj2)
Primary abstract method where, given two objects, should return an appropriate, non-negative, similarity score between the two.
 
buildFeatureDictionary(self, aString)
Create a dictionary keyed by all the k-mers (k-length substrings) of aString and N-1 variants of aString, with values equal to the number of times that k-mer appears in aString.
 
weightCalc(self, stringLen)
This function will determine the weight that a string of length stringLen (int) should be given
 
generateVariantStrings(self, aString)

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

Class Variables [hide private]
  MIN_K = 2
  weightFactor = 1
  randomOrderAtoms = <CHEM.DB.rdb.search.NameRxnPatternMatchingM...
  NUM_OF_VARIANTS = 5

Inherited from BaseKernel.BaseKernel: featureDictList, objIndex1, objIndex2

Method Details [hide private]

__init__(self, weightFactor=1)
(Constructor)

 
Constructor. Takes the value k as an argument to specify the length of the "k-mer" substrings to find in common.

similarity(self, obj1, obj2)

 
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, aString)

 
Create a dictionary keyed by all the k-mers (k-length substrings) of aString and N-1 variants of aString, with values equal to the number of times that k-mer appears in aString.
Overrides: BaseKernel.BaseKernel.buildFeatureDictionary

Class Variable Details [hide private]

randomOrderAtoms

Value:
None