class_docstr: The surrogate analyzer evaluates the performance of a surrogate model with
  respect to ranking and regression metrics.
  
  The analysis is run in parallel and should, thus, not be used in a Jupyter
  notebook. Instead, consider using the `tsbench` CLI.
docstr: Runs the evaluation on the surrogate by applying LOOCV on the datasets
  being trained on. Metrics are then provided per test dataset.
  
  Returns:
      A data frame with the results for each fold, the metrics being the columns. The rows
          are indexed by the dataset which was left out.
docstr_tok: ["Runs","the","evaluation","on","the","surrogate","by","applying","LOOCV","on","the","datasets","being","trained","on",".","Metrics","are","then","provided","per","test","dataset",".","Returns",":","A","data","frame","with","the","results","for","each","fold",",","the","metrics","being","the","columns",".","The","rows","are","indexed","by","the","dataset","which","was","left","out","."]
code: def run(self) -> pd.DataFrame:
      """
      Runs the evaluation on the surrogate by applying LOOCV on the datasets
      being trained on. Metrics are then provided per test dataset.
  
      Returns:
          A data frame with the results for each fold, the metrics being the columns. The rows
              are indexed by the dataset which was left out.
      """
      if isinstance(self.surrogate, AutoGluonSurrogate):
          metrics = [
              self._run_on_dataset(x)
              for x in tqdm(list(loocv_split(self.tracker)))
          ]
      else:
          data = list(loocv_split(self.tracker))
          metrics = run_parallel(
              self._run_on_dataset,
              data=data,
              num_processes=min(
                  num_fitting_processes(
                      cpus_per_process=self.surrogate.required_cpus,
                      memory_per_process=self.surrogate.required_memory,
                  ),
                  len(data),
              ),
          )
      return pd.concat(metrics).set_index("test_dataset")
  
file_path: gluonts/src/gluonts/nursery/tsbench/src/tsbench/analysis/surrogate/analyzer.py
imports: from typing import List, Optional, Tuple
  import numpy
  import pandas
  from tqdm.auto import tqdm
  from tsbench.analysis.utils import loocv_split, num_fitting_processes, run_parallel
  from tsbench.config import Config, ModelConfig
  from tsbench.evaluations.metrics import Performance
  from tsbench.evaluations.tracking import ModelTracker
  from tsbench.surrogate import AutoGluonSurrogate, Surrogate
  from .metrics import mrr, ndcg, nrmse, precision_k, smape
label_desc: Use image node_id 2 for calling the SurrogateAnalyzer obj's underlying member method code with example usage: obj.run() and returns: pd