class_docstr: Leave One Feature Out Importance
  Given a model and cross-validation scheme, calculates the feature importances.
  
  Parameters
  ----------
  dataset: LOFO Dataset object
  scoring: string or callable
      Same as scoring in sklearn API
  model: model (sklearn API), optional
      Not trained model object
  fit_params : dict, optional
      fit parameters for the model
  cv: int or iterable
      Same as cv in sklearn API
  n_jobs: int, optional
      Number of jobs for parallel computation
  cv_groups: array-like, with shape (n_samples,), optional
      Group labels for the samples used while splitting the dataset into train/test set. 
      Only used in conjunction with a “Group” cv instance (e.g., GroupKFold).
docstr: Run LOFO to get feature importances
  
  Returns
  -------
  importance_df : pandas dataframe
      Dataframe with feature names and corresponding importance mean and std (sorted by importance)
docstr_tok: ["Run","LOFO","to","get","feature","importances","Returns","--","--","--","-","importance_df",":","pandas","dataframe","Dataframe","with","feature","names","and","corresponding","importance","mean","and","std","(","sorted","by","importance",")"]
code: def get_importance(self):
      """Run LOFO to get feature importances
  
      Returns
      -------
      importance_df : pandas dataframe
          Dataframe with feature names and corresponding importance mean and std (sorted by importance)
      """
      base_cv_score = self._get_cv_score(feature_to_remove=None)
      feature_list = self.dataset.feature_names + list(
          self.dataset.feature_groups.keys()
      )
  
      if self.n_jobs is not None and self.n_jobs > 1:
          lofo_cv_result = parallel_apply(
              self._get_cv_score_parallel, feature_list, self.n_jobs
          )
          lofo_cv_scores_normalized = np.array(
              [
                  base_cv_score - lofo_cv_score
                  for _, lofo_cv_score in lofo_cv_result
              ]
          )
          feature_list = [feature for feature, _ in lofo_cv_result]
      else:
          lofo_cv_scores = []
          for f in tqdm(feature_list):
              lofo_cv_scores.append(
                  self._get_cv_score(feature_to_remove=f)
              )
          lofo_cv_scores_normalized = np.array(
              [
                  base_cv_score - lofo_cv_score
                  for lofo_cv_score in lofo_cv_scores
              ]
          )
  
      return lofo_to_df(lofo_cv_scores_normalized, feature_list)
  
file_path: lofo-importance/lofo/lofo_importance.py
imports: import numpy
  from sklearn.model_selection import cross_validate
  from tqdm.autonotebook import tqdm
  import warnings
  from lofo.infer_defaults import infer_model
  from lofo.utils import lofo_to_df, parallel_apply
label_desc: Use image node_id 4 for calling the LOFOImportance obj's underlying member method code with example usage: obj.get_importance() and returns: lofo_to_df