pysad.transform.ensemble.AverageOfMaximumScoreEnsembler¶
- class pysad.transform.ensemble.AverageOfMaximumScoreEnsembler(n_buckets=5, method='static', bootstrap_estimators=False)[source]¶
Maximum of average scores ensembler that outputs the maximum of average. For more details, see [BAS15] and PyOD documentation. The ensembler firt divides the scores into buckets and takes the maximum for each bucket. Then, the ensembler outputs the average of all these maximum scores of buckets.
- Parameters:
Methods
__init__
([n_buckets, method, ...])fit
(scores)Shortcut method that iteratively applies fit_partial to all instances in order.
fit_partial
(scores)Fits particular (next) timestep's score to train the ensembler.
fit_transform
(scores)Shortcut method that iteratively applies fit_transform_partial to all instances in order.
fit_transform_partial
(score)Shortcut method that iteratively applies fit_partial and transform_partial, respectively.
transform
(scores)Shortcut method that iteratively applies transform_partial to all instances in order.
transform_partial
(scores)Combines anomaly scores from multiple anomaly detectors for a particular timestep.
- fit(scores)¶
Shortcut method that iteratively applies fit_partial to all instances in order.
- Parameters:
shape (np.float64 array of) – Input scores.
- Returns:
self.
- Return type:
- fit_partial(scores)¶
Fits particular (next) timestep’s score to train the ensembler. For PYOD based ensemblers, this method does not affect anything and returns self directly.
- Parameters:
scores – np.float64 array of shape (num_anomaly_detectors, ) List of scores from multiple anomaly detectors.
- Returns:
The fitted ensembler.
- Return type:
- fit_transform(scores)¶
Shortcut method that iteratively applies fit_transform_partial to all instances in order.
- Parameters:
shape (np.float64 array of) – Input scores.
- Returns:
Processed scores.
- Return type:
np.float64 array of shape (num_instances,)
- fit_transform_partial(score)¶
Shortcut method that iteratively applies fit_partial and transform_partial, respectively.
- transform(scores)¶
Shortcut method that iteratively applies transform_partial to all instances in order.
- Parameters:
shape (np.float64 array of) – Input scores.
- Returns:
Processed scores.
- Return type:
np.float64 array of shape (num_instances,)