PredictionIntervalOutliersTransform¶
- class PredictionIntervalOutliersTransform(in_column: str, model: Union[Type[etna.models.prophet.ProphetModel], Type[etna.models.sarimax.SARIMAXModel]], interval_width: float = 0.95, **model_kwargs)[source]¶
Bases:
etna.transforms.outliers.base.OutliersTransform
Transform that uses
get_anomalies_prediction_interval()
to find anomalies in data.Create instance of PredictionIntervalOutliersTransform.
- Parameters
in_column (str) – name of processed column
model (Union[Type[ProphetModel], Type[SARIMAXModel]]) – model for prediction interval estimation
interval_width (float) – width of the prediction interval
Notes
For not “target” column only column data will be used for learning.
- Inherited-members
- Parameters
in_column (str) –
model (Union[Type[ProphetModel], Type[SARIMAXModel]]) –
interval_width (float) –
Methods
detect_outliers
(ts)Call
get_anomalies_prediction_interval()
function with self parameters.fit
(df)Find outliers using detection method.
fit_transform
(df)May be reimplemented.
inverse_transform
(df)Inverse transformation.
transform
(df)Replace found outliers with NaNs.
- detect_outliers(ts: etna.datasets.tsdataset.TSDataset) Dict[str, List[pandas._libs.tslibs.timestamps.Timestamp]] [source]¶
Call
get_anomalies_prediction_interval()
function with self parameters.- Parameters
ts (etna.datasets.tsdataset.TSDataset) – dataset to process
- Returns
dict of outliers in format {segment: [outliers_timestamps]}
- Return type
Dict[str, List[pandas._libs.tslibs.timestamps.Timestamp]]