OutliersTransform¶
- class OutliersTransform(in_column: str)[source]¶
Bases:
etna.transforms.base.Transform
,abc.ABC
Finds outliers in specific columns of DataFrame and replaces it with NaNs.
Create instance of OutliersTransform.
- Parameters
in_column (str) – name of processed column
- Inherited-members
Methods
detect_outliers
(ts)Call function for detection outliers with self parameters.
fit
(df)Find outliers using detection method.
fit_transform
(df)May be reimplemented.
Inverse transformation.
transform
(df)Replace found outliers with NaNs.
- abstract detect_outliers(ts: etna.datasets.tsdataset.TSDataset) Dict[str, List[pandas._libs.tslibs.timestamps.Timestamp]] [source]¶
Call function for detection outliers 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]]
- fit(df: pandas.core.frame.DataFrame) etna.transforms.outliers.base.OutliersTransform [source]¶
Find outliers using detection method.
- Parameters
df (pandas.core.frame.DataFrame) – dataframe with series to find outliers
- Returns
result – instance with saved outliers
- Return type
- inverse_transform(df: pandas.core.frame.DataFrame) pandas.core.frame.DataFrame [source]¶
Inverse transformation. Returns back deleted values.
- Parameters
df (pandas.core.frame.DataFrame) – data to transform
- Returns
result – data with reconstructed values
- Return type
pd.DataFrame
- transform(df: pandas.core.frame.DataFrame) pandas.core.frame.DataFrame [source]¶
Replace found outliers with NaNs.
- Parameters
df (pandas.core.frame.DataFrame) – transform
in_column
series of given dataframe- Returns
result – dataframe with in_column series with filled with NaNs
- Return type
pd.DataFrame