etna.analysis.get_anomalies_median#

get_anomalies_median(ts: TSDataset, in_column: str = 'target', window_size: int = 10, alpha: float = 3, index_only: bool = True) Dict[str, List[Timestamp] | List[int] | Series][source]#

Get point outliers in time series using median model (estimation model-based method).

Outliers are all points deviating from the median by more than alpha * std, where std is the sample standard deviation in the window.

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

  • alpha (float) – coefficient for determining the threshold

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

Returns:

dict of outliers in format {segment: [outliers_timestamps]}

Return type:

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