Skip to content

Commit 98a48ee

Browse files
authored
Merge pull request #50 from CompML/features/#40/unit_test_for_precision
Features/#40/unit test for precision
2 parents d9ab381 + bd642d8 commit 98a48ee

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/test_precision.py

+12
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,18 @@ def test_PrecisionClass_score(self):
4949
score = obj.score(real, pred)
5050
self.assertEqual(score, 1.0)
5151

52+
def test_PrecisionClass_update_precision(self):
53+
"""Test of _update_precision function.
54+
"""
55+
56+
real = np.array([1, 1, 0, 0, 0])
57+
pred = np.array([0, 1, 0, 0, 0])
58+
59+
obj = TimeSeriesPrecision()
60+
real_anomalies, predicted_anomalies = obj._prepare_data(real, pred)
61+
62+
score = obj._update_precision(real_anomalies, predicted_anomalies)
63+
self.assertEqual(score, 1.0)
5264

5365
def test_precision_function(self):
5466
"""Teest of ts_precision function.

0 commit comments

Comments
 (0)