MaximumScoreEnsembler¶
- class pysad.transform.ensemble.MaximumScoreEnsembler[source]¶
Combines the scores of multiple anomaly detectors for the current instance by taking their maximum [ZWCD20].
Methods
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)Updates the postprocessor with the next score and transforms the score.
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:
scores (np.float64 array of shape (num_instances,)) – 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,)) – 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:
scores (np.float64 array of shape (num_instances,)) – Input scores.
- Returns:
Processed scores.
- Return type:
np.float64 array of shape (num_instances,)
- fit_transform_partial(score)¶
Updates the postprocessor with the next score and transforms the score.
- transform(scores)¶
Shortcut method that iteratively applies transform_partial to all instances in order.
- Parameters:
scores (np.float64 array of shape (num_instances,)) – Input scores.
- Returns:
Processed scores.
- Return type:
np.float64 array of shape (num_instances,)