docstr: Fit the training data to FeatureSelector
  
  Paramters
  ---------
  X : array-like numpy matrix
      The training input samples, which shape is [n_samples, n_features].
  y : array-like numpy matrix
      The target values (class labels in classification, real numbers in
      regression). Which shape is [n_samples].
  lgb_params : dict
      Parameters of lightgbm
  eval_ratio : float
      The ratio of data size. It's used for split the eval data and train data from self.X.
  early_stopping_rounds : int
      The early stopping setting in lightgbm.
  importance_type : str
      Supporting type is 'gain' or 'split'.
  num_boost_round : int
      num_boost_round in lightgbm.
docstr_tok: ["Fit","the","training","data","to","FeatureSelector","Paramters","--","--","--","--","-","X",":","array-like","numpy","matrix","The","training","input","samples",",","which","shape","is","[","n_samples",",","n_features","]",".","y",":","array-like","numpy","matrix","The","target","values","(","class","labels","in","classification",",","real","numbers","in","regression",")",".","Which","shape","is","[","n_samples","]",".","lgb_params",":","dict","Parameters","of","lightgbm","eval_ratio",":","float","The","ratio","of","data","size",".","It","'s","used","for","split","the","eval","data","and","train","data","from","self.X",".","early_stopping_rounds",":","int","The","early","stopping","setting","in","lightgbm",".","importance_type",":","str","Supporting","type","is","'gain","'","or","'split","'",".","num_boost_round",":","int","num_boost_round","in","lightgbm","."]
code: def fit(self, X, y, **kwargs):
      """
      Fit the training data to FeatureSelector
  
      Paramters
      ---------
      X : array-like numpy matrix
          The training input samples, which shape is [n_samples, n_features].
      y : array-like numpy matrix
          The target values (class labels in classification, real numbers in
          regression). Which shape is [n_samples].
      lgb_params : dict
          Parameters of lightgbm
      eval_ratio : float
          The ratio of data size. It's used for split the eval data and train data from self.X.
      early_stopping_rounds : int
          The early stopping setting in lightgbm.
      importance_type : str
          Supporting type is 'gain' or 'split'.
      num_boost_round : int
          num_boost_round in lightgbm.
      """
      assert kwargs["lgb_params"]
      assert kwargs["eval_ratio"]
      assert kwargs["early_stopping_rounds"]
      assert kwargs["importance_type"]
      assert kwargs["num_boost_round"]
  
      self.X = X
      self.y = y
      self.lgb_params = kwargs["lgb_params"]
      self.eval_ratio = kwargs["eval_ratio"]
      self.early_stopping_rounds = kwargs["early_stopping_rounds"]
      self.importance_type = kwargs["importance_type"]
      self.num_boost_round = kwargs["num_boost_round"]
  
      X_train, X_test, y_train, y_test = train_test_split(
          self.X,
          self.y,
          test_size=self.eval_ratio,
          random_state=random.seed(41),
      )
      lgb_train = lgb.Dataset(X_train, y_train)
      lgb_eval = lgb.Dataset(X_test, y_test, reference=lgb_train)
  
      self.model = lgb.train(
          self.lgb_params,
          lgb_train,
          num_boost_round=self.num_boost_round,
          valid_sets=lgb_eval,
          early_stopping_rounds=self.early_stopping_rounds,
      )
  
      self.feature_importance = self.model.feature_importance(
          self.importance_type
      )
  
file_path: nni/nni/algorithms/feature_engineering/gbdt_selector/gbdt_selector.py
imports: import random
  from sklearn.model_selection import train_test_split
  import lightgbm
  from nni.feature_engineering.feature_selector import FeatureSelector
label_desc: Use image node_id 2 for calling the GBDTSelector obj's underlying member method code with example usage: obj.fit(X, y) without return types