2
$\begingroup$
def distance_metric(seed, base):
    num = 0.0
    den = 0.0
    num = sum(numpy.minimum(seed,base))
    den = sum(numpy.maximum(seed,base))
    dist = round(1.0 - 1.0*num/den,4)
    return dist

The metric is used to gauge similarity in the context of locality sensitive hashing.

Items within a bucket are kept if their distance is < 0.16.

$\endgroup$
0

1 Answer 1

1
$\begingroup$

This is the weighted Jaccard Index.

https://en.wikipedia.org/wiki/Jaccard_index#Weighted_Jaccard_similarity_and_distance

This is different from the regular Jaccard Index (Similarity).

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.