Пример #1
0
 def _fingerprint_similarity( self, f1, f2 ):
     print "computing similarity for fingerprints:    {}    {}".format(f1, f2)
     f1,f2= DictTree.intersect( f1, f2 )
     def feature_map(*features):
         f1,f2= features
         return f1.similarity(f2)
     similarities= DictTree.map( feature_map, f1, f2 )
     return self._reducer( similarities )   
Пример #2
0
def visualize_normal_composites( composites, show=True ):
    COLORS= ('red', 'orange','yellow','green', 'blue', 'violet')
    n= len(composites)
    width= 0.9-(0.1*n)
    common= DictTree.intersect( *composites )
    colors= COLORS[:n]
    for i,c,color in zip(range(n),common, colors):
        visualize_normal_composite( c, color=color, show=False, offset=i*0.1, width=width)
    if show:
        pyplot.show()
Пример #3
0
    def _fingerprint_similarity(self, f1, f2):
        print "computing similarity for fingerprints:    {}    {}".format(
            f1, f2)
        f1, f2 = DictTree.intersect(f1, f2)

        def feature_map(*features):
            f1, f2 = features
            return f1.similarity(f2)

        similarities = DictTree.map(feature_map, f1, f2)
        return self._reducer(similarities)