class_docstr: Dataset evaluator.
class_docstr_tok: ["Dataset","evaluator","."]
docstr: Calculate and return evaluation results
docstr_tok: ["Calculate","and","return","evaluation","results"]
code: def _evaluate(self):
      """Calculate and return evaluation results"""
  
      for metric in self.metrics:
          pbar = tqdm.tqdm(
              desc=f"{self.dataset_name}-{metric}-{self.model_name}",
              total=len(self.suggested_categories[metric]),
          )
  
          if metric in LabelBasedMetrics:
              for category in self.suggested_categories[metric]:
                  self._calculate_label_metrics(metric, category)
                  pbar.update(1)
          elif metric in LossBasedMetrics:
              for category in self.suggested_categories[metric]:
                  self._calculate_loss_metrics(metric, category)
                  pbar.update(1)
          elif metric in CombinedMetrics:
              for category in self.suggested_categories[metric]:
                  self._calculate_combined_metrics(metric, category)
                  pbar.update(1)
          elif metric in GPTMetrics:
              for category in self.suggested_categories[metric]:
                  self._calculate_gpt_metrics(metric, category)
                  pbar.update(1)
          elif metric in OtherMetrics:
              for category in self.suggested_categories[metric]:
                  self._calculate_other_metrics(metric, category)
                  pbar.update(1)
          else:
              raise Exception(f"{metric} not supported.")
  
      if self.judgements:
          judgement_path = os.path.join(
              self.save_path, f"{self.model_name}_judgements.json"
          )
          jdump(self.judgements, judgement_path)
  
      return self.evaluation_results
  
file_path: ColossalAI/applications/ColossalEval/colossal_eval/evaluate/dataset_evaluator/dataset_evaluator.py
imports: import os
  from typing import Dict, List, Union
  import colossal_eval.evaluate.dataset_evaluator.metrics
  import numpy
  import tqdm
  from colossal_eval.utils import jdump
  import colossal_eval.evaluate.dataset_evaluator.gpt_judge
label_desc: Use image node_id 7 for calling the DatasetEvaluator obj's underlying member method code with example usage: obj._evaluate() and returns: self