Skip to content

Commit

Permalink
Merge pull request #50 from CompML/features/#40/unit_test_for_precision
Browse files Browse the repository at this point in the history
Features/#40/unit test for precision
  • Loading branch information
nocotan authored Dec 31, 2020
2 parents d9ab381 + bd642d8 commit 98a48ee
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/test_precision.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,18 @@ def test_PrecisionClass_score(self):
score = obj.score(real, pred)
self.assertEqual(score, 1.0)

def test_PrecisionClass_update_precision(self):
"""Test of _update_precision function.
"""

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

obj = TimeSeriesPrecision()
real_anomalies, predicted_anomalies = obj._prepare_data(real, pred)

score = obj._update_precision(real_anomalies, predicted_anomalies)
self.assertEqual(score, 1.0)

def test_precision_function(self):
"""Teest of ts_precision function.
Expand Down

0 comments on commit 98a48ee

Please sign in to comment.