Package CHEM :: Package ML :: Package Similarity :: Module DotProduct :: Class DotProduct
[hide private]
[frames] | no frames]

Class DotProduct



BaseSimilarity.BaseSimilarity --+
                                |
                               DotProduct

Concrete implementation of the BaseSimilarity abstract class. Takes pairs of featureDictionaries, interprets them as sparse feature vectors, and calculates the scalar dot product between them.

Instance Methods [hide private]
 
__call__(self, featureDict1, featureDict2)
Given two dictionaries, treat these like vectors and take the "dot-product" between them.

Inherited from BaseSimilarity.BaseSimilarity: __init__, loadArgs, loadOptions, main, outputMatrix

Class Variables [hide private]

Inherited from BaseSimilarity.BaseSimilarity: inputIterFactory1, inputIterFactory2, outFile, parser

Method Details [hide private]

__call__(self, featureDict1, featureDict2)
(Call operator)

 
Given two dictionaries, treat these like vectors and take the "dot-product" between them. That is, find all items whose key is found in both dictionaries and expect the item values to be some kind of count or number. Then just take the product of those two numbers and sum up all such products.
Overrides: BaseSimilarity.BaseSimilarity.__call__