Skip to content

Commit

Permalink
update to the latest version
Browse files Browse the repository at this point in the history
  • Loading branch information
Minqi824 committed Aug 21, 2022
1 parent 1b11a2a commit 0a80f94
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion baseline/PyOD.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def grid_search(self, X_train, y_train, ratio=None):
# index of normal ana abnormal samples
idx_a = np.where(y_train==1)[0]
idx_n = np.where(y_train==0)[0]
idx_n = np.random.choice(idx_n, int(len(idx_a) / ratio), replace=True)
idx_n = np.random.choice(idx_n, int((len(idx_a) * (1-ratio)) / ratio), replace=True)

idx = np.append(idx_n, idx_a) #combine
np.random.shuffle(idx) #shuffle
Expand Down

0 comments on commit 0a80f94

Please sign in to comment.