Spectral Residual#

class oats.preprocessor.spectral_residual.SpectralResidual(amp_window_size=16, series_window_size=16, score_window_size=32)[source]#

Bases: Preprocessor

Generates a saliency map via spectral residual.

Inspired from:

Hansheng Ren, Bixiong Xu, Yujing Wang, Chao Yi, Congrui Huang, Xiaoyu Kou, Tony Xing, Mao Yang, Jie Tong, Qi Zhang. “Time-Series Anomaly Detection Service at Microsoft.” arXiv preprint arXiv:1906.03821 (2019).

Implementation: https://github.com/y-bar/ml-based-anomaly-detection

fit(*arg, **kwargs) None[source]#
transform(values: Union[_SupportsArray[dtype], _NestedSequence[_SupportsArray[dtype]], bool, int, float, complex, str, bytes, _NestedSequence[Union[bool, int, float, complex, str, bytes]]], type: str = 'avg') ndarray[Any, dtype[ScalarType]][source]#

Transform series using Spectral Residual

Parameters:
  • values – timeseries

  • type – filter type in [“avg”, “abs”, “chisq”]

Returns: