Skip to content

Commit

Permalink
update func signature
Browse files Browse the repository at this point in the history
  • Loading branch information
yzhao062 committed Jul 29, 2019
1 parent 81482d2 commit 3568ba4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
5 changes: 3 additions & 2 deletions combo/models/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ class BaseAggregator(ABC):
Parameters
----------
base_estimators: list or numpy array (n_estimators,)
A list of base estimators.
base_estimators: list, length must be greater than 1
A list of base estimators. Certain methods must be present, e.g.,
`fit` and `predict`.
pre_fitted: bool, optional (default=False)
Whether the base estimators are trained. If True, `fit`
Expand Down
17 changes: 5 additions & 12 deletions combo/models/detector_comb.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,14 @@ class SimpleDetectorAggregator(BaseAggregator):
Parameters
----------
base_estimators: list or numpy array (n_estimators,)
A list of base detectors.
base_estimators : list, length must be greater than 1
Base unsupervised outlier detectors from PyOD. (Note: requires fit and
decision_function methods)
method : str, optional (default='average')
Combination method: {'average', 'maximization',
'median'}. Pass in weights of detector for weighted version.
threshold : float in (0, 1), optional (default=0.5)
Cut-off value to convert scores into binary labels.
contamination : float in (0., 0.5), optional (default=0.1)
The amount of contamination of the data set,
i.e. the proportion of outliers in the data set. Used when fitting to
Expand Down Expand Up @@ -69,9 +67,8 @@ class SimpleDetectorAggregator(BaseAggregator):
``threshold_`` on ``decision_scores_``.
"""

def __init__(self, base_estimators, method='average', threshold=0.5,
contamination=0.1, standardization=True,
weights=None, pre_fitted=False):
def __init__(self, base_estimators, method='average', contamination=0.1,
standardization=True, weights=None, pre_fitted=False):

super(SimpleDetectorAggregator, self).__init__(
base_estimators=base_estimators, pre_fitted=pre_fitted)
Expand All @@ -89,10 +86,6 @@ def __init__(self, base_estimators, method='average', threshold=0.5,

self.standardization = standardization

check_parameter(threshold, 0, 1, include_left=False,
include_right=False, param_name='threshold')
self.threshold = threshold

if weights is None:
self.weights = np.ones([1, self.n_base_estimators_])
else:
Expand Down

0 comments on commit 3568ba4

Please sign in to comment.