def jaccard_score()

in augmentation/metrics.py [0:0]


def jaccard_score(set_1: Set, set_2: Set):
    if len(set_1) == 0 and len(set_2) == 0:
        return 1.0
    intersection_size = len(set_1.intersection(set_2))
    union_size = len(set_1) + len(set_2) - intersection_size
    return intersection_size / union_size