pysad.transform.ensemble.MedianScoreEnsembler¶
- class pysad.transform.ensemble.MedianScoreEnsembler[source]¶
An ensembler that results the median of the previous scores.
Methods
__init__
()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,)