From c3e74027270ee74eb35f6f5dabf1d5c3e6089058 Mon Sep 17 00:00:00 2001 From: yzhao062 Date: Thu, 7 Jul 2022 09:25:27 -0400 Subject: [PATCH] change test behavior due to PyOD change --- combo/test/test_detector_comb.py | 13 ++++++------- examples/detector_comb_example.py | 3 ++- examples/detector_lscp_example.py | 3 ++- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/combo/test/test_detector_comb.py b/combo/test/test_detector_comb.py index 3d59f39..7129169 100644 --- a/combo/test/test_detector_comb.py +++ b/combo/test/test_detector_comb.py @@ -10,7 +10,6 @@ from sklearn.metrics import roc_auc_score -from scipy.stats import rankdata from pyod.utils.data import generate_data from pyod.models.knn import KNN @@ -30,8 +29,8 @@ def setUp(self): self.n_test = 100 self.contamination = 0.1 self.roc_floor = 0.8 - self.X_train, self.y_train, self.X_test, self.y_test = generate_data( - n_train=self.n_train, n_test=self.n_test, + self.X_train, self.X_test, self.y_train, self.y_test = generate_data( + n_train=self.n_train, n_test=self.n_test, behaviour='new', contamination=self.contamination, random_state=42) detectors = [KNN(), LOF(), OCSVM()] @@ -98,8 +97,8 @@ def setUp(self): self.n_test = 100 self.contamination = 0.1 self.roc_floor = 0.8 - self.X_train, self.y_train, self.X_test, self.y_test = generate_data( - n_train=self.n_train, n_test=self.n_test, + self.X_train, self.X_test, self.y_train, self.y_test = generate_data( + n_train=self.n_train, n_test=self.n_test, behaviour='new', contamination=self.contamination, random_state=42) detectors = [KNN(), LOF(), OCSVM()] @@ -166,8 +165,8 @@ def setUp(self): self.n_test = 100 self.contamination = 0.1 self.roc_floor = 0.8 - self.X_train, self.y_train, self.X_test, self.y_test = generate_data( - n_train=self.n_train, n_test=self.n_test, + self.X_train, self.X_test, self.y_train, self.y_test = generate_data( + n_train=self.n_train, n_test=self.n_test, behaviour='new', contamination=self.contamination, random_state=42) detectors = [KNN(), LOF(), OCSVM()] diff --git a/examples/detector_comb_example.py b/examples/detector_comb_example.py index db693e0..310f4d7 100644 --- a/examples/detector_comb_example.py +++ b/examples/detector_comb_example.py @@ -31,11 +31,12 @@ n_test = 100 # number of testing points # Generate sample data -X_train, y_train, X_test, y_test = \ +X_train, X_test, y_train, y_test = \ generate_data(n_train=n_train, n_test=n_test, n_features=2, contamination=contamination, + behaviour='new', random_state=42) detectors = [KNN(), LOF(), OCSVM()] diff --git a/examples/detector_lscp_example.py b/examples/detector_lscp_example.py index e1b0f6b..d6d3341 100644 --- a/examples/detector_lscp_example.py +++ b/examples/detector_lscp_example.py @@ -31,11 +31,12 @@ n_test = 100 # number of testing points # Generate sample data -X_train, y_train, X_test, y_test = \ +X_train, X_test, y_train, y_test = \ generate_data(n_train=n_train, n_test=n_test, n_features=2, contamination=contamination, + behaviour='new', random_state=42) detectors = [KNN(), LOF(), OCSVM()]