class_docstr: Adapt scikit-learn transformation interface to time series setting.
  
  This is useful for applying scikit-learn :term:`tabular` transformations
  to :term:`series <Time series>`, but only works with transformations that
  do not require multiple :term:`instances <instance>` for fitting.
  
  The adaptor behaves as follows.
  If fit_in_transform = False and X is a series (pd.DataFrame, pd.Series, np.ndarray):
      ``fit(X)`` fits a clone of ``transformer`` to X (considered as a table)
      ``transform(X)`` applies transformer.transform to X and returns the result
      ``inverse_transform(X)`` applies transformer.inverse_transform to X
  If fit_in_transform = True and X is a series (pd.DataFrame, pd.Series, np.ndarray):
      ``fit`` is empty
      ``transform(X)`` applies transformer.fit(X).transform(X) to X,
          considered as a table, and returns the result
      ``inverse_transform(X)`` applies transformer.fit(X).inverse_transform(X) to X
  
  If fit_in_transform = False, and X is of a panel/hierarchical type:
      ``fit(X)`` fits a clone of ``transformer`` for each individual series x in X
      ``transform(X)`` applies transform(x) of the clone belonging to x,
              (where the index of x in transform equals the index of x in fit)
          for each individual series x in X, and returns the result
      ``inverse_transform(X)`` applies transform(x) of the clone belonging to x,
              (where the index of x in transform equals the index of x in fit)
          for each individual series x in X, and returns the result
      Note: instances indices in transform/inverse_transform
          must be equal to those seen in fit
  If fit_in_transform = True, and X is of a panel/hierarchical type:
      ``fit`` is empty
      ``transform(X)`` applies transformer.fit(x).transform(x)
          to all individual series x in X and returns the result
      ``inverse_transform(X)`` applies transformer.fit(x).inverse_transform(x)
          to all individual series x in X and returns the result
  
  WARNING: if fit_in_transform is set to False,
      when applied to Panel or Hierarchical data,
      the resulting transformer will identify individual series in test set
      with series indices in training set, on which instances were fit
      in particular, transform will not work if number of instances
          and indices of instances in transform are different from those in fit
  WARNING: if fit_in_transform is set to True,
      then each series in the test set will be transformed as batch by fit-predict,
      this may cause information leakage in a forecasting setting
          (but not in a time series classification/regression/clustering setting,
          because in these settings the independent samples are the individual series)
  
  Whether ``y`` is passed to transformer methods is controlled by ``pass_y``.
  If the inner transformer has non-defaulting ``y`` args, the default behaviour is
  to pass ``y`` to ``fit``, ``fit_transform``, or ``transform``.
  If no ``y`` arg is present, or if it has a default value, ``y`` is not passed.
  
  Parameters
  ----------
  transformer : Estimator
      scikit-learn-like transformer to fit and apply to series.
      This is used as a "blueprint" and not fitted or otherwise mutated.
  fit_in_transform: bool, optional, default=False
      whether transformer_ should be fitted in transform (True), or in fit (False)
          recommended setting in forecasting (single series or hierarchical): False
          recommended setting in ts classification, regression, clustering: True
  pass_y : str, optional, one of "auto" (default), "fit", "always", "never"
      Whether to pass y to transformer methods of the ``transformer`` clone.
      "auto": passes y to methods fit, transform, fit_transform, inverse_transform,
          if and only if y is a named arg of either method without default.
          Note: passes y even if it is None
      "fit": passes y to method fit, but not to transform.
          Note: passes y even if it is None, or if not a named arg
      "always": passes y to all methods, fit, transform, inverse_transform.
          Note: passes y even if it is None, or if not a named arg
      "never": never passes y to any method.
  
  Attributes
  ----------
  transformer_ : Estimator
      Transformer that is fitted to data, clone of transformer.
  
  Examples
  --------
  >>> from sktime.transformations.series.adapt import TabularToSeriesAdaptor
  >>> from sklearn.preprocessing import MinMaxScaler
  >>> from sktime.datasets import load_airline
  >>> y = load_airline()
  >>> transformer = TabularToSeriesAdaptor(MinMaxScaler())
  >>> y_hat = transformer.fit_transform(y)
class_docstr_tok: ["Adapt","scikit-learn","transformation","interface","to","time","series","setting",".","This","is","useful","for","applying","scikit-learn",":","term",":","`","tabular","`","transformations","to",":","term",":","`","series","<","Time","series",">","`",",","but","only","works","with","transformations","that","do","not","require","multiple",":","term",":","`","instances","<","instance",">","`","for","fitting",".","The","adaptor","behaves","as","follows",".","If","fit_in_transform","=","False","and","X","is","a","series","(","pd.DataFrame",",","pd.Series",",","np.ndarray",")",":","``","fit","(","X",")","``","fits","a","clone","of","``","transformer","``","to","X","(","considered","as","a","table",")","``","transform","(","X",")","``","applies","transformer.transform","to","X","and","returns","the","result","``","inverse_transform","(","X",")","``","applies","transformer.inverse_transform","to","X","If","fit_in_transform","=","True","and","X","is","a","series","(","pd.DataFrame",",","pd.Series",",","np.ndarray",")",":","``","fit","``","is","empty","``","transform","(","X",")","``","applies","transformer.fit","(","X",")",".transform","(","X",")","to","X",",","considered","as","a","table",",","and","returns","the","result","``","inverse_transform","(","X",")","``","applies","transformer.fit","(","X",")",".inverse_transform","(","X",")","to","X","If","fit_in_transform","=","False",",","and","X","is","of","a","panel\/hierarchical","type",":","``","fit","(","X",")","``","fits","a","clone","of","``","transformer","``","for","each","individual","series","x","in","X","``","transform","(","X",")","``","applies","transform","(","x",")","of","the","clone","belonging","to","x",",","(","where","the","index","of","x","in","transform","equals","the","index","of","x","in","fit",")","for","each","individual","series","x","in","X",",","and","returns","the","result","``","inverse_transform","(","X",")","``","applies","transform","(","x",")","of","the","clone","belonging","to","x",",","(","where","the","index","of","x","in","transform","equals","the","index","of","x","in","fit",")","for","each","individual","series","x","in","X",",","and","returns","the","result","Note",":","instances","indices","in","transform\/inverse_transform","must","be","equal","to","those","seen","in","fit","If","fit_in_transform","=","True",",","and","X","is","of","a","panel\/hierarchical","type",":","``","fit","``","is","empty","``","transform","(","X",")","``","applies","transformer.fit","(","x",")",".transform","(","x",")","to","all","individual","series","x","in","X","and","returns","the","result","``","inverse_transform","(","X",")","``","applies","transformer.fit","(","x",")",".inverse_transform","(","x",")","to","all","individual","series","x","in","X","and","returns","the","result","WARNING",":","if","fit_in_transform","is","set","to","False",",","when","applied","to","Panel","or","Hierarchical","data",",","the","resulting","transformer","will","identify","individual","series","in","test","set","with","series","indices","in","training","set",",","on","which","instances","were","fit","in","particular",",","transform","will","not","work","if","number","of","instances","and","indices","of","instances","in","transform","are","different","from","those","in","fit","WARNING",":","if","fit_in_transform","is","set","to","True",",","then","each","series","in","the","test","set","will","be","transformed","as","batch","by","fit-predict",",","this","may","cause","information","leakage","in","a","forecasting","setting","(","but","not","in","a","time","series","classification\/regression\/clustering","setting",",","because","in","these","settings","the","independent","samples","are","the","individual","series",")","Whether","``","y","``","is","passed","to","transformer","methods","is","controlled","by","``","pass_y","``",".","If","the","inner","transformer","has","non-defaulting","``","y","``","args",",","the","default","behaviour","is","to","pass","``","y","``","to","``","fit","``",",","``","fit_transform","``",",","or","``","transform","``",".","If","no","``","y","``","arg","is","present",",","or","if","it","has","a","default","value",",","``","y","``","is","not","passed",".","Parameters","--","--","--","--","--","transformer",":","Estimator","scikit-learn-like","transformer","to","fit","and","apply","to","series",".","This","is","used","as","a","``","blueprint","''","and","not","fitted","or","otherwise","mutated",".","fit_in_transform",":","bool",",","optional",",","default=False","whether","transformer_","should","be","fitted","in","transform","(","True",")",",","or","in","fit","(","False",")","recommended","setting","in","forecasting","(","single","series","or","hierarchical",")",":","False","recommended","setting","in","ts","classification",",","regression",",","clustering",":","True","pass_y",":","str",",","optional",",","one","of","``","auto","''","(","default",")",",","``","fit","''",",","``","always","''",",","``","never","''","Whether","to","pass","y","to","transformer","methods","of","the","``","transformer","``","clone",".","``","auto","''",":","passes","y","to","methods","fit",",","transform",",","fit_transform",",","inverse_transform",",","if","and","only","if","y","is","a","named","arg","of","either","method","without","default",".","Note",":","passes","y","even","if","it","is","None","``","fit","''",":","passes","y","to","method","fit",",","but","not","to","transform",".","Note",":","passes","y","even","if","it","is","None",",","or","if","not","a","named","arg","``","always","''",":","passes","y","to","all","methods",",","fit",",","transform",",","inverse_transform",".","Note",":","passes","y","even","if","it","is","None",",","or","if","not","a","named","arg","``","never","''",":","never","passes","y","to","any","method",".","Attributes","--","--","--","--","--","transformer_",":","Estimator","Transformer","that","is","fitted","to","data",",","clone","of","transformer",".","Examples","--","--","--","--",">",">",">","from","sktime.transformations.series.adapt","import","TabularToSeriesAdaptor",">",">",">","from","sklearn.preprocessing","import","MinMaxScaler",">",">",">","from","sktime.datasets","import","load_airline",">",">",">","y","=","load_airline","(",")",">",">",">","transformer","=","TabularToSeriesAdaptor","(","MinMaxScaler","(",")",")",">",">",">","y_hat","=","transformer.fit_transform","(","y",")"]
code: def __init__(
      self, transformer, fit_in_transform=False, pass_y="auto"
  ):
      self.transformer = transformer
      self.transformer_ = clone(self.transformer)
      self.fit_in_transform = fit_in_transform
      self.pass_y = pass_y
  
      super().__init__()
  
      if hasattr(transformer, "inverse_transform"):
          self.set_tags(**{"capability:inverse_transform": True})
  
      # sklearn transformers that are known to fit in transform do not need fit
      if hasattr(transformer, "_get_tags"):
          trafo_fit_in_transform = transformer._get_tags()["stateless"]
      else:
          trafo_fit_in_transform = False
  
      self._skip_fit = fit_in_transform or trafo_fit_in_transform
  
      if self._skip_fit:
          self.set_tags(**{"fit_is_empty": True})
  
      trafo_has_y, trafo_has_y_default = self._trafo_has_y_and_default(
          "fit"
      )
      need_y = trafo_has_y and not trafo_has_y_default
      if need_y or pass_y not in ["auto", "no"]:
          self.set_tags(**{"y_inner_mtype": "numpy1D"})
  
file_path: sktime/sktime/transformations/series/adapt.py
imports: from inspect import signature
  import numpy
  from sklearn.base import clone
  from sktime.transformations.base import BaseTransformer
label_desc: Use image node_id 1 to create a new TabularToSeriesAdaptor object from inherited base classes: BaseTransformer with example: obj = TabularToSeriesAdaptor(transformer, fit_in_transform, pass_y)