etna.analysis.get_anomalies_iqr#

get_anomalies_iqr(ts: TSDataset, in_column: str = 'target', window_size: int = 10, stride: int = 1, iqr_scale: float = 1.5, trend: bool = False, seasonality: bool = False, period: int | None = None, stl_params: Dict[str, Any] | None = None, index_only: bool = True) Dict[str, List[Timestamp] | List[int] | Series][source]#

Get point outliers in time series using IQR statistics, estimated on a rolling window.

Outliers are all points that fall outside the estimated interval.

Parameters:
  • ts (TSDataset) – TSDataset with timeseries data

  • in_column (str) – name of the column in which the anomaly is searching

  • window_size (int) – number of points in the window

  • stride (int) – offset between neighboring windows.

  • iqr_scale (float) – scaling parameter of the estimated interval.

  • trend (bool) – whether to remove trend from the series.

  • seasonality (bool) – whether to remove seasonality from the series

  • period (int | None) – periodicity of the sequence for STL.

  • stl_params (Dict[str, Any] | None) – other parameters for STL. See statsmodels.tsa.seasonal.STL

  • index_only (bool) – whether to return only outliers indices. If False will return outliers series

Returns:

mapping from segment names to corresponding outliers.

Return type:

Dict[str, List[Timestamp] | List[int] | Series]