diff --git a/README.md b/README.md index cd92cc6..b383237 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,3 @@ - # TODS: Automated Time-series Outlier Detection System Logo diff --git a/tods/detection_algorithm/core/MultiAutoRegOD.py b/tods/detection_algorithm/core/MultiAutoRegOD.py index 9ef92b3..01834bc 100644 --- a/tods/detection_algorithm/core/MultiAutoRegOD.py +++ b/tods/detection_algorithm/core/MultiAutoRegOD.py @@ -154,6 +154,12 @@ class MultiAutoRegOD(CollectiveBaseDetector): self.decision_scores_ = self._score_combination( self._decison_mat_scalaled) + # print(self.decision_scores_.shape, self.left_inds_.shape, self.right_inds_.shape) + self.decision_scores_ = np.concatenate((np.zeros((self.window_size,)), self.decision_scores_)) + self.left_inds_ = np.concatenate(((-self.window_size) * np.ones((self.window_size,)).astype(np.int), self.left_inds_)) + self.right_inds_ = np.concatenate((np.zeros((self.window_size,)).astype(np.int), self.right_inds_)) + # print(self.decision_scores_.shape, self.left_inds_.shape, self.right_inds_.shape) + self._process_decision_scores() return self diff --git a/tods/tests/detection_algorithm/test_AutoRegODetect.py b/tods/tests/detection_algorithm/test_AutoRegODetect.py index 759aabc..24cadf7 100644 --- a/tods/tests/detection_algorithm/test_AutoRegODetect.py +++ b/tods/tests/detection_algorithm/test_AutoRegODetect.py @@ -28,10 +28,10 @@ class AutoRegODetectTestCase(unittest.TestCase): self.X_train = d3m_dataframe({'data': [3., 4., 8., 16, 18, 13., 22., 36., 59., 128, 62, 67, 78, 100]}, columns=['data'], generate_metadata=True) - self.y_train = np.array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]) + self.y_train = np.array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]) self.X_test = d3m_dataframe({'data': [3., 4., 8.6, 13.4, 22.5, 17, 19.2, 36.1, 127, -23, 59.2]}, columns=['data'], generate_metadata=True) - self.y_test = np.array([0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0]) + self.y_test = np.array([0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0]) @@ -46,6 +46,8 @@ class AutoRegODetectTestCase(unittest.TestCase): self.prediction_labels = self.primitive.produce(inputs=self.X_test).value self.prediction_score = self.primitive.produce_score(inputs=self.X_test).value + # print(self.prediction_labels) + self.collective_common_test = CollectiveCommonTest(model=self.primitive._clf, X_train=self.X_train, y_train=self.y_train,