Skip to content

Commit

Permalink
fix issue of contamination
Browse files Browse the repository at this point in the history
  • Loading branch information
yzhao062 committed Nov 18, 2023
1 parent 9e15d2c commit 898e41b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
3 changes: 2 additions & 1 deletion CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -180,4 +180,5 @@ v<1.0.9>, <03/19/2023> -- Hot fix for errors in ECOD and COPOD due to the issue
v<1.1.0>, <06/19/2023> -- Further integration of PyThresh.
v<1.1.1>, <07/03/2023> -- Bump up sklearn requirement and some hot fixes.
v<1.1.1>, <10/24/2023> -- Add deep isolation forest (#506).
v<1.1.2>, <11/17/2023> -- Massive documentation optimization.
v<1.1.2>, <11/17/2023> -- Massive documentation optimization.
v<1.1.2>, <11/17/2023> -- Fix the issue of contamination.
4 changes: 2 additions & 2 deletions pyod/models/lunar.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ class LUNAR(BaseDetector):

def __init__(self, model_type="WEIGHT", n_neighbours=5, negative_sampling="MIXED",
val_size=0.1, scaler=MinMaxScaler(), epsilon=0.1, proportion=1.0,
n_epochs=200, lr=0.001, wd=0.1, verbose=0):
super(LUNAR, self).__init__()
n_epochs=200, lr=0.001, wd=0.1, verbose=0, contamination=0.1):
super(LUNAR, self).__init__(contamination=contamination)

self.model_type = model_type
self.n_neighbours = n_neighbours
Expand Down
6 changes: 2 additions & 4 deletions pyod/models/mad.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,8 @@ class MAD(BaseDetector):
``threshold_`` on ``decision_scores_``.
"""

def __init__(self, threshold=3.5):
# contamination is unneeded since threshold must be
# decided manually by the user
super(MAD, self).__init__()
def __init__(self, threshold=3.5, contamination=0.1):
super(MAD, self).__init__(contamination=contamination)
if not isinstance(threshold, (float, int)):
raise TypeError(
'threshold must be a number. Got {}'.format(type(threshold)))
Expand Down

0 comments on commit 898e41b

Please sign in to comment.