class_docstr: Sklearn-compatible estimator to calculate relevant features out of a time series and add them to a data sample.
  
  As many other sklearn estimators, this estimator works in two steps:
  
  In the fit phase, all possible time series features are calculated using the time series, that is set by the
  set_timeseries_container function (if the features are not manually changed by handing in a
  feature_extraction_settings object). Then, their significance and relevance to the target is computed using
  statistical methods and only the relevant ones are selected using the Benjamini Hochberg procedure. These features
  are stored internally.
  
  In the transform step, the information on which features are relevant from the fit step is used and those features
  are extracted from the time series. These extracted features are then added to the input data sample.
  
  This estimator is a wrapper around most of the functionality in the tsfresh package. For more information on the
  subtasks, please refer to the single modules and functions, which are:
  
  * Settings for the feature extraction: :class:`~tsfresh.feature_extraction.settings.ComprehensiveFCParameters`
  * Feature extraction method: :func:`~tsfresh.feature_extraction.extraction.extract_features`
  * Extracted features: :mod:`~tsfresh.feature_extraction.feature_calculators`
  * Feature selection: :func:`~tsfresh.feature_selection.feature_selector.check_fs_sig_bh`
  
  This estimator works analogue to the :class:`~tsfresh.transformers.feature_augmenter.FeatureAugmenter` with
  the difference that this estimator does only output and calculate the relevant features,
  whereas the other outputs all features.
  
  Also for this estimator, two datasets play a crucial role:
  
  1. the time series container with the timeseries data. This container (for the format see
     :mod:`~tsfresh.feature_extraction.extraction`) contains the data which is used for calculating the
     features. It must be groupable by ids which are used to identify which feature should be attached to which row
     in the second dataframe:
  
  2. the input data, where the features will be added to.
  
  Imagine the following situation: You want to classify 10 different financial shares and you have their development
  in the last year as a time series. You would then start by creating features from the metainformation of the
  shares, e.g. how long they were on the market etc. and filling up a table - the features of one stock in one row.
  
  >>> # Fill in the information of the stocks and the target
  >>> X_train, X_test, y_train = pd.DataFrame(), pd.DataFrame(), pd.Series()
  
  You can then extract all the relevant features from the time development of the shares, by using this estimator:
  
  >>> train_time_series, test_time_series = read_in_timeseries() # get the development of the shares
  >>> from tsfresh.transformers import RelevantFeatureAugmenter
  >>> augmenter = RelevantFeatureAugmenter()
  >>> augmenter.set_timeseries_container(train_time_series)
  >>> augmenter.fit(X_train, y_train)
  >>> augmenter.set_timeseries_container(test_time_series)
  >>> X_test_with_features = augmenter.transform(X_test)
  
  X_test_with_features will then contain the same information as X_test (with all the meta information you have
  probably added) plus some relevant time series features calculated on the time series you handed in.
  
  Please keep in mind that the time series you hand in before fit or transform must contain data for the rows that are
  present in X.
  
  If your set filter_only_tsfresh_features to True, your manually-created features that were present in X_train (or
  X_test) before using this estimator are not touched. Otherwise, also those features are evaluated and may be
  rejected from the data sample, because they are irrelevant.
  
  For a description what the parameters column_id, column_sort, column_kind and column_value mean, please see
  :mod:`~tsfresh.feature_extraction.extraction`.
  
  You can control the feature extraction in the fit step (the feature extraction in the transform step is done
  automatically) as well as the feature selection in the fit step by handing in settings.
  However, the default settings which are used if you pass no flags are often quite sensible.
class_docstr_tok: ["Sklearn-compatible","estimator","to","calculate","relevant","features","out","of","a","time","series","and","add","them","to","a","data","sample",".","As","many","other","sklearn","estimators",",","this","estimator","works","in","two","steps",":","In","the","fit","phase",",","all","possible","time","series","features","are","calculated","using","the","time","series",",","that","is","set","by","the","set_timeseries_container","function","(","if","the","features","are","not","manually","changed","by","handing","in","a","feature_extraction_settings","object",")",".","Then",",","their","significance","and","relevance","to","the","target","is","computed","using","statistical","methods","and","only","the","relevant","ones","are","selected","using","the","Benjamini","Hochberg","procedure",".","These","features","are","stored","internally",".","In","the","transform","step",",","the","information","on","which","features","are","relevant","from","the","fit","step","is","used","and","those","features","are","extracted","from","the","time","series",".","These","extracted","features","are","then","added","to","the","input","data","sample",".","This","estimator","is","a","wrapper","around","most","of","the","functionality","in","the","tsfresh","package",".","For","more","information","on","the","subtasks",",","please","refer","to","the","single","modules","and","functions",",","which","are",":","*","Settings","for","the","feature","extraction",":",":","class",":","`","~tsfresh.feature_extraction.settings.ComprehensiveFCParameters","`","*","Feature","extraction","method",":",":","func",":","`","~tsfresh.feature_extraction.extraction.extract_features","`","*","Extracted","features",":",":","mod",":","`","~tsfresh.feature_extraction.feature_calculators","`","*","Feature","selection",":",":","func",":","`","~tsfresh.feature_selection.feature_selector.check_fs_sig_bh","`","This","estimator","works","analogue","to","the",":","class",":","`","~tsfresh.transformers.feature_augmenter.FeatureAugmenter","`","with","the","difference","that","this","estimator","does","only","output","and","calculate","the","relevant","features",",","whereas","the","other","outputs","all","features",".","Also","for","this","estimator",",","two","datasets","play","a","crucial","role",":","1.","the","time","series","container","with","the","timeseries","data",".","This","container","(","for","the","format","see",":","mod",":","`","~tsfresh.feature_extraction.extraction","`",")","contains","the","data","which","is","used","for","calculating","the","features",".","It","must","be","groupable","by","ids","which","are","used","to","identify","which","feature","should","be","attached","to","which","row","in","the","second","dataframe",":","2.","the","input","data",",","where","the","features","will","be","added","to",".","Imagine","the","following","situation",":","You","want","to","classify","10","different","financial","shares","and","you","have","their","development","in","the","last","year","as","a","time","series",".","You","would","then","start","by","creating","features","from","the","metainformation","of","the","shares",",","e.g",".","how","long","they","were","on","the","market","etc",".","and","filling","up","a","table","-","the","features","of","one","stock","in","one","row",".",">",">",">","#","Fill","in","the","information","of","the","stocks","and","the","target",">",">",">","X_train",",","X_test",",","y_train","=","pd.DataFrame","(",")",",","pd.DataFrame","(",")",",","pd.Series","(",")","You","can","then","extract","all","the","relevant","features","from","the","time","development","of","the","shares",",","by","using","this","estimator",":",">",">",">","train_time_series",",","test_time_series","=","read_in_timeseries","(",")","#","get","the","development","of","the","shares",">",">",">","from","tsfresh.transformers","import","RelevantFeatureAugmenter",">",">",">","augmenter","=","RelevantFeatureAugmenter","(",")",">",">",">","augmenter.set_timeseries_container","(","train_time_series",")",">",">",">","augmenter.fit","(","X_train",",","y_train",")",">",">",">","augmenter.set_timeseries_container","(","test_time_series",")",">",">",">","X_test_with_features","=","augmenter.transform","(","X_test",")","X_test_with_features","will","then","contain","the","same","information","as","X_test","(","with","all","the","meta","information","you","have","probably","added",")","plus","some","relevant","time","series","features","calculated","on","the","time","series","you","handed","in",".","Please","keep","in","mind","that","the","time","series","you","hand","in","before","fit","or","transform","must","contain","data","for","the","rows","that","are","present","in","X",".","If","your","set","filter_only_tsfresh_features","to","True",",","your","manually-created","features","that","were","present","in","X_train","(","or","X_test",")","before","using","this","estimator","are","not","touched",".","Otherwise",",","also","those","features","are","evaluated","and","may","be","rejected","from","the","data","sample",",","because","they","are","irrelevant",".","For","a","description","what","the","parameters","column_id",",","column_sort",",","column_kind","and","column_value","mean",",","please","see",":","mod",":","`","~tsfresh.feature_extraction.extraction","`",".","You","can","control","the","feature","extraction","in","the","fit","step","(","the","feature","extraction","in","the","transform","step","is","done","automatically",")","as","well","as","the","feature","selection","in","the","fit","step","by","handing","in","settings",".","However",",","the","default","settings","which","are","used","if","you","pass","no","flags","are","often","quite","sensible","."]
docstr: Equivalent to :func:`~fit` followed by :func:`~transform`; however, this is faster than performing those steps
  separately, because it avoids re-extracting relevant features for training data.
  
  :param X: The data frame without the time series features. The index rows should be present in the timeseries
     and in the target vector.
  :type X: pandas.DataFrame or numpy.array
  
  :param y: The target vector to define, which features are relevant.
  :type y: pandas.Series or numpy.array
  
  :return: a data sample with the same information as X, but with added relevant time series features and
      deleted irrelevant information (only if filter_only_tsfresh_features is False).
  :rtype: pandas.DataFrame
docstr_tok: ["Equivalent","to",":","func",":","`","~fit","`","followed","by",":","func",":","`","~transform","`",";","however",",","this","is","faster","than","performing","those","steps","separately",",","because","it","avoids","re-extracting","relevant","features","for","training","data",".",":","param","X",":","The","data","frame","without","the","time","series","features",".","The","index","rows","should","be","present","in","the","timeseries","and","in","the","target","vector",".",":","type","X",":","pandas.DataFrame","or","numpy.array",":","param","y",":","The","target","vector","to","define",",","which","features","are","relevant",".",":","type","y",":","pandas.Series","or","numpy.array",":","return",":","a","data","sample","with","the","same","information","as","X",",","but","with","added","relevant","time","series","features","and","deleted","irrelevant","information","(","only","if","filter_only_tsfresh_features","is","False",")",".",":","rtype",":","pandas.DataFrame"]
code: def fit_transform(self, X, y):
      """
      Equivalent to :func:`~fit` followed by :func:`~transform`; however, this is faster than performing those steps
      separately, because it avoids re-extracting relevant features for training data.
  
      :param X: The data frame without the time series features. The index rows should be present in the timeseries
         and in the target vector.
      :type X: pandas.DataFrame or numpy.array
  
      :param y: The target vector to define, which features are relevant.
      :type y: pandas.Series or numpy.array
  
      :return: a data sample with the same information as X, but with added relevant time series features and
          deleted irrelevant information (only if filter_only_tsfresh_features is False).
      :rtype: pandas.DataFrame
      """
      X_augmented = self._fit_and_augment(X, y)
  
      selected_features = X_augmented.copy().loc[
          :, self.feature_selector.relevant_features
      ]
  
      if self.filter_only_tsfresh_features:
          selected_features = pd.merge(
              selected_features,
              X,
              left_index=True,
              right_index=True,
              how="left",
          )
  
      return selected_features
  
file_path: tsfresh/tsfresh/transformers/relevant_feature_augmenter.py
imports: from functools import partial
  import pandas
  from sklearn.base import BaseEstimator, TransformerMixin
  from tsfresh import defaults
  from tsfresh.feature_extraction.settings import from_columns
  from tsfresh.transformers.feature_augmenter import FeatureAugmenter
  from tsfresh.transformers.feature_selector import FeatureSelector
  from tsfresh.utilities.dataframe_functions import get_range_values_per_column, impute_dataframe_range
label_desc: Use image node_id 5 for calling the RelevantFeatureAugmenter obj's underlying member method code with example usage: obj.fit_transform(X, y) and returns: selected_features