Back

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

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.

30.9k questions

32.9k answers

500 comments

665 users