def jaccard_distance(label1, label2):
 return ((len(label1.union(label2)) - len(label1.intersection(label2))) / len(label1.union(label2)))

def jaccard_distance ( label1 , label2 ) : return ( ( len ( label1 . union ( label2 ) ) - len ( label1 . intersection ( label2 ) ) ) / len ( label1 . union ( label2 ) ) )
distance metric comparing set-similarity .