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.
31k questions
32.8k answers
501 comments
693 users