From 439addcb12a48a16e047a82dbc8a1c13f77a768f Mon Sep 17 00:00:00 2001 From: lhenry15 Date: Fri, 18 Jun 2021 01:18:32 -0500 Subject: [PATCH] fix ski KDiscord unittest --- .../sk_interface/detection_algorithm/test_ski_KDiscordODetector.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tods/tests/sk_interface/detection_algorithm/test_ski_KDiscordODetector.py b/tods/tests/sk_interface/detection_algorithm/test_ski_KDiscordODetector.py index 0c945da..86d3b72 100644 --- a/tods/tests/sk_interface/detection_algorithm/test_ski_KDiscordODetector.py +++ b/tods/tests/sk_interface/detection_algorithm/test_ski_KDiscordODetector.py @@ -22,11 +22,13 @@ class KDiscordODetectorSKI_TestCase(unittest.TestCase): self.n_test = 100 self.contamination = 0.1 self.roc_floor = 0.0 + self.window_size = 5 self.X_train, self.y_train, self.X_test, self.y_test = generate_data( n_train=self.n_train, n_test=self.n_test, contamination=self.contamination, random_state=42) - self.transformer = KDiscordODetectorSKI(contamination=self.contamination) + self.transformer = KDiscordODetectorSKI(contamination=self.contamination, window_size=self.window_size) + self.y_test = self.y_test[self.window_size-1:] self.transformer.fit(self.X_train) def test_prediction_labels(self):