class_docstr: Fast LOFO Importance
  Applies already trained model on validation set by noising one feature each time.
  
  Parameters
  ----------
  trained_model: model (sklearn API)
      The model should be trained already
  validation_df: pandas dataframe
  features: list of strings
      List of column names for features within validation_df
  target: string
      Column name for target within validation_df
  scoring: string or callable
      Same as scoring in sklearn API
  n_jobs: int, optional
      Number of jobs for parallel computation
class_docstr_tok: ["Fast","LOFO","Importance","Applies","already","trained","model","on","validation","set","by","noising","one","feature","each","time",".","Parameters","--","--","--","--","--","trained_model",":","model","(","sklearn","API",")","The","model","should","be","trained","already","validation_df",":","pandas","dataframe","features",":","list","of","strings","List","of","column","names","for","features","within","validation_df","target",":","string","Column","name","for","target","within","validation_df","scoring",":","string","or","callable","Same","as","scoring","in","sklearn","API","n_jobs",":","int",",","optional","Number","of","jobs","for","parallel","computation"]
docstr: Run FLOFO to get feature importances
  
  Parameters
  ----------
  num_sampling : int, optional
      Number of times features are shuffled
  random_state : int, optional
      Random seed
  
  Returns
  -------
  importance_df : pandas dataframe
      Dataframe with feature names and corresponding importance mean and std (sorted by importance)
docstr_tok: ["Run","FLOFO","to","get","feature","importances","Parameters","--","--","--","--","--","num_sampling",":","int",",","optional","Number","of","times","features","are","shuffled","random_state",":","int",",","optional","Random","seed","Returns","--","--","--","-","importance_df",":","pandas","dataframe","Dataframe","with","feature","names","and","corresponding","importance","mean","and","std","(","sorted","by","importance",")"]
code: def get_importance(self, num_sampling=10, random_state=0):
      """Run FLOFO to get feature importances
  
      Parameters
      ----------
      num_sampling : int, optional
          Number of times features are shuffled
      random_state : int, optional
          Random seed
  
      Returns
      -------
      importance_df : pandas dataframe
          Dataframe with feature names and corresponding importance mean and std (sorted by importance)
      """
      np.random.seed(random_state)
      base_score = self._get_score(self.df)
      self.num_sampling = num_sampling
  
      if self.n_jobs is not None and self.n_jobs > 1:
          lofo_cv_scores = parallel_apply(
              self._run_parallel, self.features, self.n_jobs
          )
          lofo_cv_scores_normalized = np.array(
              [
                  base_score - lofo_cv_score
                  for f, lofo_cv_score in lofo_cv_scores
              ]
          )
          self.features = [score[0] for score in lofo_cv_scores]
      else:
          lofo_cv_scores = []
          for f in tqdm(self.features):
              lofo_cv_scores.append(self._run(f, num_sampling))
          lofo_cv_scores_normalized = np.array(
              [
                  base_score - lofo_cv_score
                  for lofo_cv_score in lofo_cv_scores
              ]
          )
  
      return lofo_to_df(lofo_cv_scores_normalized, self.features)
  
file_path: lofo-importance/lofo/flofo_importance.py
imports: import numpy
  import pandas
  from tqdm.autonotebook import tqdm
  import warnings
  from sklearn.metrics import check_scoring
  from lofo.utils import lofo_to_df, parallel_apply
label_desc: Use image node_id 6 for calling the FLOFOImportance obj's underlying member method code with example usage: obj.get_importance(num_sampling, random_state) and returns: lofo_to_df