Explore Courses Blog Tutorials Interview Questions
0 votes
in Python by (50.2k points)
I am having two lists with usernames and I want to compute the Jaccard similarity. I want to know whether it is possible?

1 Answer

0 votes
by (108k points)

Do check the below code for the reference regarding Jaccard  similarity:

def jaccard_similarity(list1, list2):

    intersection = len(list(set(list1).intersection(list2)))

    union = (len(list1) + len(list2)) - intersection

    return float(intersection) / union

For more information regarding the same, do refer to the Python online course that will help you regarding the same in a better way. 

Related questions

Welcome to Intellipaat Community. Get your technical queries answered by top developers!

30.5k questions

32.6k answers


108k users

Browse Categories