Skip to content

Commit

Permalink
refactor documentation to numpydoc
Browse files Browse the repository at this point in the history
  • Loading branch information
yzhao062 authored and yuezhao@cs.toronto.edu committed Nov 25, 2018
1 parent 781ac74 commit edaae18
Showing 1 changed file with 34 additions and 26 deletions.
60 changes: 34 additions & 26 deletions pyod/models/combination.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,28 +133,32 @@ def aom(scores, n_buckets=5, method='static', bootstrap_estimators=False,
First dividing estimators into subgroups, take the maximum score as the
subgroup score. Finally, take the average of all subgroup outlier scores.
:param scores: The score matrix outputted from various estimators
:type scores: numpy array of shape (n_samples, n_estimators)
Parameters
----------
scores : numpy array of shape (n_samples, n_estimators)
The score matrix outputted from various estimators
:param n_buckets: The number of subgroups to build
:type n_buckets: int, optional (default=5)
n_buckets : int, optional (default=5)
The number of subgroups to build
:param method: {'static', 'dynamic'}, if 'dynamic', build subgroups
method : str, optional (default='static')
{'static', 'dynamic'}, if 'dynamic', build subgroups
randomly with dynamic bucket size.
:type method: str, optional (default='static')
:param bootstrap_estimators: Whether estimators are drawn with replacement.
:type bootstrap_estimators: bool, optional (default=False)
bootstrap_estimators : bool, optional (default=False)
Whether estimators are drawn with replacement.
:param random_state: If int, random_state is the seed used by the
random_state : int, RandomState instance or None, optional (default=None)
If int, random_state is the seed used by the
random number generator; If RandomState instance, random_state is
the random number generator; If None, the random number generator
is the RandomState instance used by `np.random`.
:type random_state: int, RandomState instance or None,
optional (default=None)
:return: The combined outlier scores.
:rtype: Numpy array of shape (n_samples,)
Returns
-------
combined_scores : Numpy array of shape (n_samples,)
The combined outlier scores.
"""
return _aom_moa_helper('AOM', scores, n_buckets, method,
bootstrap_estimators, random_state)
Expand All @@ -169,28 +173,32 @@ def moa(scores, n_buckets=5, method='static', bootstrap_estimators=False,
subgroup score. Finally, take the maximization of all subgroup outlier
scores.
:param scores: The score matrix outputted from various estimators
:type scores: numpy array of shape (n_samples, n_estimators)
Parameters
----------
scores : numpy array of shape (n_samples, n_estimators)
The score matrix outputted from various estimators
:param n_buckets: The number of subgroups to build
:type n_buckets: int, optional (default=5)
n_buckets : int, optional (default=5)
The number of subgroups to build
:param method: {'static', 'dynamic'}, if 'dynamic', build subgroups
method : str, optional (default='static')
{'static', 'dynamic'}, if 'dynamic', build subgroups
randomly with dynamic bucket size.
:type method: str, optional (default='static')
:param bootstrap_estimators: Whether estimators are drawn with replacement.
:type bootstrap_estimators: bool, optional (default=False)
bootstrap_estimators : bool, optional (default=False)
Whether estimators are drawn with replacement.
:param random_state: If int, random_state is the seed used by the
random_state : int, RandomState instance or None, optional (default=None)
If int, random_state is the seed used by the
random number generator; If RandomState instance, random_state is
the random number generator; If None, the random number generator
is the RandomState instance used by `np.random`.
:type random_state: int, RandomState instance or None,
optional (default=None)
:return: The combined outlier scores.
:rtype: Numpy array of shape (n_samples,)
Returns
-------
combined_scores : Numpy array of shape (n_samples,)
The combined outlier scores.
"""
return _aom_moa_helper('MOA', scores, n_buckets, method,
bootstrap_estimators, random_state)
Expand Down

0 comments on commit edaae18

Please sign in to comment.