class_docstr: Distance based Outlier BasIs using Neighbors (DOBIN).
  
  DOBIN is a pre-processing algorithm that constructs a set of basis
  vectors tailored for outlier detection as described by _[1]. DOBIN
  has a simple mathematical foundation and can be used as a dimension
  reduction tool for outlier detection tasks.
  
  Method assumes normalized data, the original R code implementation uses:
  ``from sklearn.preprocessing import MinMaxScaler, RobustScaler, StandardScaler``
  This prevents variables with large variances having disproportional
  influence on Euclidean distances. The original implelemtation _[1] uses
  ``MinMaxScaler`` normalization, and removes NA values before normalization.
  
  We emphasize that DOBIN is not an outlier detection method; rather it is
  a pre-processing step that can be used by any outlier detection method.
  
  Parameters
  ----------
  frac : float (default=0.95)
      The cut-off quantile for Y space
      (parameter q in _[1]).
  k : int (default=None)
      Number of nearest neighbours considered
      (parameter k_2 on page 9 in _[1])
  
  Attributes
  ----------
  _basis : pd.DataFrame
      The basis vectors suitable for outlier detection
      (denoted as Theta in _[1]).
  _coords : pd.DataFrame
      The transformed coordinates of the data
      (denoted as tilde{X}, see equation 8 in _[1])
  
  References
  ----------
  .. [1] Kandanaarachchi, Sevvandi, and Rob J. Hyndman. "Dimension reduction
  for outlier detection using DOBIN." Journal of Computational and Graphical
  Statistics 30.1 (2021): 204-219.
  
  Examples
  --------
  >>> from sktime.transformations.series.dobin import DOBIN  # doctest: +SKIP
  >>> from sklearn.preprocessing import MinMaxScaler  # doctest: +SKIP
  >>> import numpy as np  # doctest: +SKIP
  >>> import pandas as pd  # doctest: +SKIP
  >>> from sktime.datasets import load_uschange  # doctest: +SKIP
  >>> _, X = load_uschange()  # doctest: +SKIP
  >>> scaler = MinMaxScaler()  # doctest: +SKIP
  >>> X = scaler.fit_transform(X)  # doctest: +SKIP
  >>> model = DOBIN()  # doctest: +SKIP
  >>> X_outlier = model.fit_transform(pd.DataFrame(X))  # doctest: +SKIP
  >>> X_outlier.head()  # doctest: +SKIP
          DB0       DB1       DB2       DB3
  0  1.151965  0.116488  0.286064  0.288140
  1  1.191976  0.100772  0.050835  0.225985
  2  1.221158  0.078031  0.034030  0.249676
  3  1.042420  0.188494  0.218460  0.205251
  4  1.224701  0.020028 -0.294705  0.199827
class_docstr_tok: ["Distance","based","Outlier","BasIs","using","Neighbors","(","DOBIN",")",".","DOBIN","is","a","pre-processing","algorithm","that","constructs","a","set","of","basis","vectors","tailored","for","outlier","detection","as","described","by","_","[","1","]",".","DOBIN","has","a","simple","mathematical","foundation","and","can","be","used","as","a","dimension","reduction","tool","for","outlier","detection","tasks",".","Method","assumes","normalized","data",",","the","original","R","code","implementation","uses",":","``","from","sklearn.preprocessing","import","MinMaxScaler",",","RobustScaler",",","StandardScaler","``","This","prevents","variables","with","large","variances","having","disproportional","influence","on","Euclidean","distances",".","The","original","implelemtation","_","[","1","]","uses","``","MinMaxScaler","``","normalization",",","and","removes","NA","values","before","normalization",".","We","emphasize","that","DOBIN","is","not","an","outlier","detection","method",";","rather","it","is","a","pre-processing","step","that","can","be","used","by","any","outlier","detection","method",".","Parameters","--","--","--","--","--","frac",":","float","(","default=0.95",")","The","cut-off","quantile","for","Y","space","(","parameter","q","in","_","[","1","]",")",".","k",":","int","(","default=None",")","Number","of","nearest","neighbours","considered","(","parameter","k_2","on","page","9","in","_","[","1","]",")","Attributes","--","--","--","--","--","_basis",":","pd.DataFrame","The","basis","vectors","suitable","for","outlier","detection","(","denoted","as","Theta","in","_","[","1","]",")",".","_coords",":","pd.DataFrame","The","transformed","coordinates","of","the","data","(","denoted","as","tilde","{","X","}",",","see","equation","8","in","_","[","1","]",")","References","--","--","--","--","--","..","[","1","]","Kandanaarachchi",",","Sevvandi",",","and","Rob","J.","Hyndman",".","``","Dimension","reduction","for","outlier","detection","using","DOBIN",".","''","Journal","of","Computational","and","Graphical","Statistics","30.1","(","2021",")",":","204-219",".","Examples","--","--","--","--",">",">",">","from","sktime.transformations.series.dobin","import","DOBIN","#","doctest",":","+SKIP",">",">",">","from","sklearn.preprocessing","import","MinMaxScaler","#","doctest",":","+SKIP",">",">",">","import","numpy","as","np","#","doctest",":","+SKIP",">",">",">","import","pandas","as","pd","#","doctest",":","+SKIP",">",">",">","from","sktime.datasets","import","load_uschange","#","doctest",":","+SKIP",">",">",">","_",",","X","=","load_uschange","(",")","#","doctest",":","+SKIP",">",">",">","scaler","=","MinMaxScaler","(",")","#","doctest",":","+SKIP",">",">",">","X","=","scaler.fit_transform","(","X",")","#","doctest",":","+SKIP",">",">",">","model","=","DOBIN","(",")","#","doctest",":","+SKIP",">",">",">","X_outlier","=","model.fit_transform","(","pd.DataFrame","(","X",")",")","#","doctest",":","+SKIP",">",">",">","X_outlier.head","(",")","#","doctest",":","+SKIP","DB0","DB1","DB2","DB3","0","1.151965","0.116488","0.286064","0.288140","1","1.191976","0.100772","0.050835","0.225985","2","1.221158","0.078031","0.034030","0.249676","3","1.042420","0.188494","0.218460","0.205251","4","1.224701","0.020028","-0.294705","0.199827"]
docstr: Transform X and return a transformed version.
  
  private _transform containing core logic, called from transform
  
  Parameters
  ----------
  X : Series of mtype X_inner_mtype
      Data to be transformed
  y : Series of mtype y_inner_mtype, default=None
      Not required for this unsupervised transform.
  
  Returns
  -------
  transformed version of X, representing the original data on a new set of
  coordinates, obtained by multiplying input data by the basis vectors.
docstr_tok: ["Transform","X","and","return","a","transformed","version",".","private","_transform","containing","core","logic",",","called","from","transform","Parameters","--","--","--","--","--","X",":","Series","of","mtype","X_inner_mtype","Data","to","be","transformed","y",":","Series","of","mtype","y_inner_mtype",",","default=None","Not","required","for","this","unsupervised","transform",".","Returns","--","--","--","-","transformed","version","of","X",",","representing","the","original","data","on","a","new","set","of","coordinates",",","obtained","by","multiplying","input","data","by","the","basis","vectors","."]
code: def _transform(self, X, y=None):
      """Transform X and return a transformed version.
  
      private _transform containing core logic, called from transform
  
      Parameters
      ----------
      X : Series of mtype X_inner_mtype
          Data to be transformed
      y : Series of mtype y_inner_mtype, default=None
          Not required for this unsupervised transform.
  
      Returns
      -------
      transformed version of X, representing the original data on a new set of
      coordinates, obtained by multiplying input data by the basis vectors.
      """
      # fit again if indices not seen, but don't store anything
      if not X.index.equals(self._X.index):
          X_full = X.combine_first(self._X)
          new_dobin = DOBIN(
              frac=self.frac,
              k=self.k,
          ).fit(X_full)
          warnings.warn(
              "Warning: Input data X differs from that given to fit(). "
              "Refitting with new input data, not storing updated public class "
              "attributes. For this, explicitly use fit(X) or fit_transform(X).",
              stacklevel=2,
          )
          return new_dobin._coords
  
      return self._coords
  
file_path: sktime/sktime/transformations/series/dobin.py
imports: import warnings
  import numpy
  import numpy.typing
  import pandas
  from pandas.api.types import is_numeric_dtype
  from sklearn.decomposition import PCA
  from sklearn.neighbors import NearestNeighbors
  from sktime.transformations.base import BaseTransformer
label_desc: Use image node_id 3 for calling the DOBIN obj's underlying member method code with example usage: obj._transform(X, y) and returns: self, new_dobin