class_docstr: Select predefined feature subsets.
class_docstr_tok: ["Select","predefined","feature","subsets","."]
docstr: Fit FeatureSetSelector for feature selection
  
  Parameters
  ----------
  X: array-like of shape (n_samples, n_features)
      The training input samples.
  y: array-like, shape (n_samples,)
      The target values (integers that correspond to classes in classification, real numbers in regression).
  
  Returns
  -------
  self: object
      Returns a copy of the estimator
docstr_tok: ["Fit","FeatureSetSelector","for","feature","selection","Parameters","--","--","--","--","--","X",":","array-like","of","shape","(","n_samples",",","n_features",")","The","training","input","samples",".","y",":","array-like",",","shape","(","n_samples",",",")","The","target","values","(","integers","that","correspond","to","classes","in","classification",",","real","numbers","in","regression",")",".","Returns","--","--","--","-","self",":","object","Returns","a","copy","of","the","estimator"]
code: def fit(self, X, y=None):
      """Fit FeatureSetSelector for feature selection
  
      Parameters
      ----------
      X: array-like of shape (n_samples, n_features)
          The training input samples.
      y: array-like, shape (n_samples,)
          The target values (integers that correspond to classes in classification, real numbers in regression).
  
      Returns
      -------
      self: object
          Returns a copy of the estimator
      """
      subset_df = pd.read_csv(self.subset_list, header=0, index_col=0)
  
      if isinstance(self.sel_subset, int):
          self.sel_subset_name = subset_df.index[self.sel_subset]
      elif isinstance(self.sel_subset, str):
          self.sel_subset_name = self.sel_subset
      else:  # list or tuple
          self.sel_subset_name = []
          for s in self.sel_subset:
              if isinstance(s, int):
                  self.sel_subset_name.append(subset_df.index[s])
              else:
                  self.sel_subset_name.append(s)
  
      sel_features = subset_df.loc[self.sel_subset_name, "Features"]
      if not isinstance(sel_features, str):
          sel_features = ";".join(sel_features.tolist())
  
      sel_uniq_features = set(sel_features.split(";"))
  
      if isinstance(X, pd.DataFrame):  # use columns' names
          self.feature_names = list(X.columns.values)
          self.feat_list = sorted(
              list(
                  set(sel_uniq_features).intersection(
                      set(self.feature_names)
                  )
              )
          )
          self.feat_list_idx = [
              list(X.columns).index(feat_name)
              for feat_name in self.feat_list
          ]
      elif isinstance(X, np.ndarray):  # use index
          self.feature_names = list(range(X.shape[1]))
          sel_uniq_features = [int(val) for val in sel_uniq_features]
          self.feat_list = sorted(
              list(
                  set(sel_uniq_features).intersection(
                      set(self.feature_names)
                  )
              )
          )
          self.feat_list_idx = self.feat_list
  
      if not len(self.feat_list):
          raise ValueError("No feature is found on the subset list!")
      return self
  
file_path: tpot/tpot/builtins/feature_set_selector.py
imports: import numpy
  import pandas
  import os, os.path
  from sklearn.base import BaseEstimator
label_desc: Use image node_id 3 for calling the FeatureSetSelector obj's underlying member method code with example usage: obj.fit(X, y) and returns: self