Skip to content

Commit

Permalink
update cosine similarity example
Browse files Browse the repository at this point in the history
  • Loading branch information
GreatYYX committed Mar 8, 2017
1 parent 53aca43 commit d6116ba
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions rltk/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -608,12 +608,8 @@ def cosine_similarity(self, set1, set2):
float: Consine similarity.
Examples:
>>> tk.cosine_similarity(set([1,2]), set([3,4]))
0.0
>>> tk.cosine_similarity(set([1,2]), set([2,3]))
0.5
>>> tk.cosine_similarity(set([1,2]), set([1,2]))
1.0
>>> tk.cosine_similarity([1, 2, 1, 3], [2, 5, 2, 3])
0.916341933823
"""
return cosine_similarity(set1, set2)

Expand Down

0 comments on commit d6116ba

Please sign in to comment.