class_docstr: Use HampelFilter to detect outliers based on a sliding window.
  
  Correction of outliers is recommended by means of the sktime.Imputer,
  so both can be tuned separately.
  
  Parameters
  ----------
  window_length : int, optional (default=10)
      Length of the sliding window
  n_sigma : int, optional
      Defines how strong a point must outly to be an "outlier", by default 3
  k : float, optional
      A constant scale factor which is dependent on the distribution,
      for Gaussian it is approximately 1.4826, by default 1.4826
  return_bool : bool, optional
      If True, outliers are filled with True and non-outliers with False.
      Else, outliers are filled with np.nan.
  
  Notes
  -----
  Implementation is based on [1]_.
  
  References
  ----------
  .. [1] Hampel F. R., "The influence curve and its role in robust estimation",
     Journal of the American Statistical Association, 69, 382–393, 1974
  
  Examples
  --------
  >>> from sktime.transformations.series.outlier_detection import HampelFilter
  >>> from sktime.datasets import load_airline
  >>> y = load_airline()
  >>> transformer = HampelFilter(window_length=10)
  >>> y_hat = transformer.fit_transform(y)
class_docstr_tok: ["Use","HampelFilter","to","detect","outliers","based","on","a","sliding","window",".","Correction","of","outliers","is","recommended","by","means","of","the","sktime.Imputer",",","so","both","can","be","tuned","separately",".","Parameters","--","--","--","--","--","window_length",":","int",",","optional","(","default=10",")","Length","of","the","sliding","window","n_sigma",":","int",",","optional","Defines","how","strong","a","point","must","outly","to","be","an","``","outlier","''",",","by","default","3","k",":","float",",","optional","A","constant","scale","factor","which","is","dependent","on","the","distribution",",","for","Gaussian","it","is","approximately","1.4826",",","by","default","1.4826","return_bool",":","bool",",","optional","If","True",",","outliers","are","filled","with","True","and","non-outliers","with","False",".","Else",",","outliers","are","filled","with","np.nan",".","Notes","--","--","-","Implementation","is","based","on","[","1","]","_.","References","--","--","--","--","--","..","[","1","]","Hampel","F.","R.",",","``","The","influence","curve","and","its","role","in","robust","estimation","''",",","Journal","of","the","American","Statistical","Association",",","69",",","382\u2013393",",","1974","Examples","--","--","--","--",">",">",">","from","sktime.transformations.series.outlier_detection","import","HampelFilter",">",">",">","from","sktime.datasets","import","load_airline",">",">",">","y","=","load_airline","(",")",">",">",">","transformer","=","HampelFilter","(","window_length=10",")",">",">",">","y_hat","=","transformer.fit_transform","(","y",")"]
docstr: Transform X and return a transformed version.
  
  private _transform containing the core logic, called from transform
  
  Parameters
  ----------
  X : pd.Series or pd.DataFrame
      Data to be transformed
  y : ignored argument for interface compatibility
      Additional data, e.g., labels for transformation
  
  Returns
  -------
  Xt : pd.Series or pd.DataFrame, same type as X
      transformed version of X
docstr_tok: ["Transform","X","and","return","a","transformed","version",".","private","_transform","containing","the","core","logic",",","called","from","transform","Parameters","--","--","--","--","--","X",":","pd.Series","or","pd.DataFrame","Data","to","be","transformed","y",":","ignored","argument","for","interface","compatibility","Additional","data",",","e.g.",",","labels","for","transformation","Returns","--","--","--","-","Xt",":","pd.Series","or","pd.DataFrame",",","same","type","as","X","transformed","version","of","X"]
code: def _transform(self, X, y=None):
      """Transform X and return a transformed version.
  
      private _transform containing the core logic, called from transform
  
      Parameters
      ----------
      X : pd.Series or pd.DataFrame
          Data to be transformed
      y : ignored argument for interface compatibility
          Additional data, e.g., labels for transformation
  
      Returns
      -------
      Xt : pd.Series or pd.DataFrame, same type as X
          transformed version of X
      """
      Z = X.copy()
  
      # multivariate
      if isinstance(Z, pd.DataFrame):
          for col in Z:
              Z[col] = self._transform_series(Z[col])
      # univariate
      else:
          Z = self._transform_series(Z)
  
      Xt = Z
      return Xt
  
file_path: sktime/sktime/transformations/series/outlier_detection.py
imports: import warnings
  from math import ceil
  import numpy
  import pandas
  from sktime.split import SlidingWindowSplitter
  from sktime.transformations.base import BaseTransformer
label_desc: Use image node_id 2 for calling the HampelFilter obj's underlying member method code with example usage: obj._transform(X, y) and returns: Xt