Skip to content

Commit

Permalink
Update dissim.py
Browse files Browse the repository at this point in the history
  • Loading branch information
AGMortimer committed Jun 7, 2019
1 parent 0e85ec9 commit 8a2d62b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kmodes/util/dissim.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ def calc_dissim(b, X, memj, idr):

def jaccard_dissim(a, b, **_):
"""Jaccard distance function"""
i = np.sum((a == 1) & (b == 1), axis=1)
i = np.sum((a == 1) & (b == 1), axis=1)
j = np.sum((a == 1) | (b == 1), axis=1)
if j.any != 0:
return ((j - i) /j)
return (( j - i ) / j )
else:
return 1

0 comments on commit 8a2d62b

Please sign in to comment.