Skip to content

Commit

Permalink
Merge pull request #63 from CompML/features/#41/unit_test_for_recall
Browse files Browse the repository at this point in the history
add test case
  • Loading branch information
nocotan authored Jan 2, 2021
2 parents bfed388 + 76c5cb1 commit a63f0e9
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions tests/test_recall.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,20 @@ def test_recall_function(self):
"""Teest of ts_recall function.
"""

real = np.array([1, 1, 0, 0, 0])
pred = np.array([1, 1, 1, 1, 0])
# test case1
real = np.array([1, 0, 0, 0, 0])
pred = np.array([1, 1, 0, 0, 0])

score = ts_recall(real, pred)
self.assertEqual(score, 1.0)

# test case2
real = np.array([1, 1, 0, 0, 0])
pred = np.array([0, 0, 1, 1, 1])

score = ts_recall(real, pred)
self.assertEqual(score, 0.0)

def test_recall_function_with_list(self):
"""Teest of ts_recall function with list type arguments.
"""
Expand Down

0 comments on commit a63f0e9

Please sign in to comment.