def jaccard_distance(label1, label2):
    """Jaccard distance metric"""
    union_len = len(label1 | label2)
    intersection_len = len(label1 & label2)
    return (union_len - intersection_len) / float(union_len)