def test_detect_anomalies_fit_pipeine_dict(self): pipeline = load_pipeline('dummy') anomalies = functional.detect_anomalies(data=self.anomalous, pipeline=pipeline, train_data=self.clean) pd.testing.assert_frame_equal(self.events, anomalies)
def test_detect_anomalies_fitted_orion(self): orion = functional.fit_pipeline(self.clean, 'dummy') anomalies = functional.detect_anomalies( data=self.anomalous, pipeline=orion, ) pd.testing.assert_frame_equal(self.events, anomalies)
def test_detect_anomalies_saved_orion(self, tmpdir): orion_path = os.path.join(tmpdir, 'orion.pkl') functional.fit_pipeline(self.clean, 'dummy', save_path=orion_path) anomalies = functional.detect_anomalies( data=self.anomalous, pipeline=orion_path, ) pd.testing.assert_frame_equal(self.events, anomalies)
def test_detect_anomalies_fit_hyperparams(self): hyperparams = { "orion.primitives.detectors.ThresholdDetector#1": { "ratio": 0.9 } } anomalies = functional.detect_anomalies(data=self.anomalous, hyperparameters=hyperparams, train_data=self.clean) pd.testing.assert_frame_equal(self.events, anomalies)
def test_detect_anomalies_fit_pipeline(self): anomalies = functional.detect_anomalies(data=self.anomalous, pipeline='dummy', train_data=self.clean) pd.testing.assert_frame_equal(self.events, anomalies)
def test_detect_anomalies_fit_default(self): anomalies = functional.detect_anomalies(data=self.anomalous, train_data=self.clean) pd.testing.assert_frame_equal(self.events, anomalies)