Skip to content

Commit

Permalink
change test behavior due to PyOD change
Browse files Browse the repository at this point in the history
  • Loading branch information
yzhao062 authored and yzhao062 committed Jul 7, 2022
1 parent 229d578 commit c3e7402
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
13 changes: 6 additions & 7 deletions combo/test/test_detector_comb.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()]
Expand Down Expand Up @@ -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()]
Expand Down Expand Up @@ -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()]
Expand Down
3 changes: 2 additions & 1 deletion examples/detector_comb_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()]
Expand Down
3 changes: 2 additions & 1 deletion examples/detector_lscp_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()]
Expand Down

0 comments on commit c3e7402

Please sign in to comment.