Skip to content

Commit a63f0e9

Browse files
authored
Merge pull request #63 from CompML/features/#41/unit_test_for_recall
add test case
2 parents bfed388 + 76c5cb1 commit a63f0e9

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

tests/test_recall.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,20 @@ def test_recall_function(self):
6565
"""Teest of ts_recall function.
6666
"""
6767

68-
real = np.array([1, 1, 0, 0, 0])
69-
pred = np.array([1, 1, 1, 1, 0])
68+
# test case1
69+
real = np.array([1, 0, 0, 0, 0])
70+
pred = np.array([1, 1, 0, 0, 0])
7071

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

75+
# test case2
76+
real = np.array([1, 1, 0, 0, 0])
77+
pred = np.array([0, 0, 1, 1, 1])
78+
79+
score = ts_recall(real, pred)
80+
self.assertEqual(score, 0.0)
81+
7482
def test_recall_function_with_list(self):
7583
"""Teest of ts_recall function with list type arguments.
7684
"""

0 commit comments

Comments
 (0)