Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __call__(self, *sequences):
sequences = self._get_counters(*sequences) # sets
intersection = self._intersect_counters(*sequences) # set
sequences = (self._count_counters(sequence - intersection) for sequence in sequences)
# ^ ints
return max(sequences)
bag = Bag()
cosine = Cosine()
dice = Sorensen()
jaccard = Jaccard()
monge_elkan = MongeElkan()
overlap = Overlap()
sorensen = Sorensen()
sorensen_dice = Sorensen()
# sorensen_dice = Tversky(ks=[.5, .5])
tanimoto = Tanimoto()
tversky = Tversky()
"""
def __call__(self, *sequences):
sequences = self._get_counters(*sequences) # sets
intersection = self._intersect_counters(*sequences) # set
sequences = (self._count_counters(sequence - intersection) for sequence in sequences)
# ^ ints
return max(sequences)
bag = Bag()
cosine = Cosine()
dice = Sorensen()
jaccard = Jaccard()
monge_elkan = MongeElkan()
overlap = Overlap()
sorensen = Sorensen()
sorensen_dice = Sorensen()
# sorensen_dice = Tversky(ks=[.5, .5])
tanimoto = Tanimoto()
tversky = Tversky()
class Bag(_Base):
"""Bag distance
https://github.com/Yomguithereal/talisman/blob/master/src/metrics/distance/bag.js
"""
def __call__(self, *sequences):
sequences = self._get_counters(*sequences) # sets
intersection = self._intersect_counters(*sequences) # set
sequences = (self._count_counters(sequence - intersection) for sequence in sequences)
# ^ ints
return max(sequences)
bag = Bag()
cosine = Cosine()
dice = Sorensen()
jaccard = Jaccard()
monge_elkan = MongeElkan()
overlap = Overlap()
sorensen = Sorensen()
sorensen_dice = Sorensen()
# sorensen_dice = Tversky(ks=[.5, .5])
tanimoto = Tanimoto()
tversky = Tversky()