class_docstr: Handles evaluation of a given model over a specified dataset.
code: def log_results(
      results,
      dataset_name,
      steps,
      logging=True,
      print=True,
      num_fold=None,
  ):
      # Print a header
      header = "\n\n"
      header += BUSH_SEP + "\n"
      header += "***************************************************\n"
      if num_fold:
          header += f"***** EVALUATION | FOLD: {num_fold} | {dataset_name.upper()} SET | AFTER {steps} BATCHES *****\n"
      else:
          header += f"***** EVALUATION | {dataset_name.upper()} SET | AFTER {steps} BATCHES *****\n"
      header += "***************************************************\n"
      header += BUSH_SEP + "\n"
      logger.info(header)
  
      for head_num, head in enumerate(results):
          logger.info(
              "\n _________ {} _________".format(head["task_name"])
          )
          for metric_name, metric_val in head.items():
              # log with ML framework (e.g. Mlflow)
              if logging:
                  if not metric_name in [
                      "preds",
                      "labels",
                  ] and not metric_name.startswith("_"):
                      if isinstance(metric_val, numbers.Number):
                          MlLogger.log_metrics(
                              metrics={
                                  f"{dataset_name}_{metric_name}_{head['task_name']}": metric_val
                              },
                              step=steps,
                          )
              # print via standard python logger
              if print:
                  if metric_name == "report":
                      if (
                          isinstance(metric_val, str)
                          and len(metric_val) > 8000
                      ):
                          metric_val = (
                              metric_val[:7500]
                              + "\n ............................. \n"
                              + metric_val[-500:]
                          )
                      logger.info(
                          "{}: \n {}".format(metric_name, metric_val)
                      )
                  else:
                      if not metric_name in [
                          "preds",
                          "labels",
                      ] and not metric_name.startswith("_"):
                          logger.info(
                              "{}: {}".format(metric_name, metric_val)
                          )
  
file_path: FARM/farm/eval.py
imports: from tqdm import tqdm
  import torch
  import numbers
  import logging
  import numpy
  from torch.utils.data import DataLoader
  from farm.evaluation.metrics import compute_metrics, compute_report_metrics
  from farm.utils import to_numpy
  from farm.utils import MLFlowLogger
  from farm.modeling.adaptive_model import AdaptiveModel
  from farm.modeling.biadaptive_model import BiAdaptiveModel
  from farm.visual.ascii.images import BUSH_SEP
label_desc: Use image node_id 3 for calling the Evaluator obj's underlying member method code with example usage: obj.log_results(results, dataset_name, steps, logging, print, num_fold) without return types