class_docstr: Sklearn-compatible estimator, for reducing the number of features in a dataset to only those,
  that are relevant and significant to a given target. It is basically a wrapper around
  :func:`~tsfresh.feature_selection.feature_selector.check_fs_sig_bh`.
  
  The check is done by testing the hypothesis
  
      :math:`H_0` = the Feature is not relevant and can not be added`
  
  against
  
      :math:`H_1` = the Feature is relevant and should be kept
  
  using several statistical tests (depending on whether the feature or/and the target is binary
  or not). Using the Benjamini Hochberg procedure, only features in :math:`H_0` are rejected.
  
  This estimator - as most of the sklearn estimators - works in a two step procedure. First, it is fitted
  on training data, where the target is known:
  
  >>> import pandas as pd
  >>> X_train, y_train = pd.DataFrame(), pd.Series() # fill in with your features and target
  >>> from tsfresh.transformers import FeatureSelector
  >>> selector = FeatureSelector()
  >>> selector.fit(X_train, y_train)
  
  In this example the list of relevant features is empty:
  
  >>> selector.relevant_features
  >>> []
  
  The same holds for the feature importance:
  
  >>> selector.feature_importances_
  >>> array([], dtype=float64)
  
  The estimator keeps track on those features, that were relevant in the training step. If you
  apply the estimator after the training, it will delete all other features in the testing
  data sample:
  
  >>> X_test = pd.DataFrame()
  >>> X_selected = selector.transform(X_test)
  
  After that, X_selected will only contain the features that were relevant during the training.
  
  If you are interested in more information on the features, you can look into the member
  ``relevant_features`` after the fit.
docstr: Extract the information, which of the features are relevant using the given target.
  
  For more information, please see the :func:`~tsfresh.festure_selection.festure_selector.check_fs_sig_bh`
  function. All columns in the input data sample are treated as feature. The index of all
  rows in X must be present in y.
  
  :param X: data sample with the features, which will be classified as relevant or not
  :type X: pandas.DataFrame or numpy.array
  
  :param y: target vector to be used, to classify the features
  :type y: pandas.Series or numpy.array
  
  :return: the fitted estimator with the information, which features are relevant
  :rtype: FeatureSelector
code: def fit(self, X, y):
      """
      Extract the information, which of the features are relevant using the given target.
  
      For more information, please see the :func:`~tsfresh.festure_selection.festure_selector.check_fs_sig_bh`
      function. All columns in the input data sample are treated as feature. The index of all
      rows in X must be present in y.
  
      :param X: data sample with the features, which will be classified as relevant or not
      :type X: pandas.DataFrame or numpy.array
  
      :param y: target vector to be used, to classify the features
      :type y: pandas.Series or numpy.array
  
      :return: the fitted estimator with the information, which features are relevant
      :rtype: FeatureSelector
      """
      if not isinstance(X, pd.DataFrame):
          X = pd.DataFrame(X.copy())
  
      if not isinstance(y, pd.Series):
          y = pd.Series(y.copy())
  
      relevance_table = calculate_relevance_table(
          X,
          y,
          ml_task=self.ml_task,
          multiclass=self.multiclass,
          n_significant=self.n_significant,
          n_jobs=self.n_jobs,
          chunksize=self.chunksize,
          fdr_level=self.fdr_level,
          hypotheses_independent=self.hypotheses_independent,
          test_for_binary_target_real_feature=self.test_for_binary_target_real_feature,
      )
      self.relevant_features = relevance_table.loc[
          relevance_table.relevant
      ].feature.tolist()
  
      if self.multiclass:
          p_values_table = relevance_table.filter(
              regex="^p_value_*", axis=1
          )
          if self.multiclass_p_values == "all":
              self.p_values = p_values_table
              self.feature_importances_ = 1.0 - p_values_table
              self.feature_importances_.columns = (
                  self.feature_importances_.columns.str.lstrip(
                      "p_value"
                  )
              )
              self.feature_importances_ = (
                  self.feature_importances_.add_prefix("importance_")
              )
          elif self.multiclass_p_values == "min":
              self.p_values = p_values_table.min(axis=1).values
          elif self.multiclass_p_values == "max":
              self.p_values = p_values_table.max(axis=1).values
          elif self.multiclass_p_values == "avg":
              self.p_values = p_values_table.mean(axis=1).values
  
          if self.multiclass_p_values != "all":
              # raise p_values to the power of n_significant to increase importance
              # of features which are significant for more classes
              self.feature_importances_ = (
                  1.0
                  - self.p_values
                  ** relevance_table.n_significant.values
              )
      else:
          self.feature_importances_ = (
              1.0 - relevance_table.p_value.values
          )
          self.p_values = relevance_table.p_value.values
  
      self.features = relevance_table.index.tolist()
  
      return self
  
file_path: tsfresh/tsfresh/transformers/feature_selector.py
imports: import pandas
  from sklearn.base import BaseEstimator, TransformerMixin
  from tsfresh import defaults
  from tsfresh.feature_selection.relevance import calculate_relevance_table
label_desc: Use image node_id 2 for calling the FeatureSelector obj's underlying member method code with example usage: obj.fit(X, y) and returns: self