Skip to content

Fix minor typing errors in maths/ #8959

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Aug 15, 2023
Prev Previous commit
Next Next commit
Update maths/jaccard_similarity.py
Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
  • Loading branch information
CaedenPH and tianyizheng02 authored Aug 14, 2023
commit eaa8775a9743037ece94210f21bc095f97cd2dfb
2 changes: 1 addition & 1 deletion maths/jaccard_similarity.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def jaccard_similarity(
intersection = [element for element in set_a if element in set_b]

if alternative_union:
return len(intersection) / len(set_a) + len(set_b)
return len(intersection) / (len(set_a) + len(set_b))
else:
# Cast set_a to list because tuples cannot be mutated
union = list(set_a) + [element for element in set_b if element not in set_a]
Expand Down