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.


This is the weighted Jaccard Index.


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


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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