class_docstr: Basic tests on the eval_model.py example.
class_docstr_tok: ["Basic","tests","on","the","eval_model.py","example","."]
code: def test_multitasking_metrics_macro(self):
      valid, test = testing_utils.eval_model(
          {
              "task": "integration_tests:candidate,"
              "integration_tests:multiturnCandidate",
              "model": "random_candidate",
              "aggregate_micro": False,
          }
      )
  
      task1_acc = valid["integration_tests:candidate/accuracy"]
      task2_acc = valid["integration_tests:multiturnCandidate/accuracy"]
      total_acc = valid["accuracy"]
      # task 2 is 4 times the size of task 1
      self.assertEqual(
          total_acc,
          (task1_acc.value() + task2_acc.value()) * 0.5,
          "Task accuracy is averaged incorrectly",
      )
  
      valid, test = testing_utils.eval_model(
          {
              "task": "integration_tests:candidate,"
              "integration_tests:multiturnCandidate",
              "model": "random_candidate",
              "aggregate_micro": False,
          }
      )
      task1_acc = valid["integration_tests:candidate/accuracy"]
      task2_acc = valid["integration_tests:multiturnCandidate/accuracy"]
      total_acc = valid["accuracy"]
  
      # metrics are combined correctly
      self.assertEqual(
          total_acc,
          (task1_acc.value() + task2_acc.value()) * 0.5,
          "Task accuracy is averaged incorrectly",
      )
  
file_path: ParlAI/tests/test_eval_model.py
imports: import os
  from parlai.utils.io import PathManager
  import pytest
  import unittest
  import parlai.utils.testing
  from parlai.scripts.eval_model import get_task_world_logs
label_desc: Use image node_id 6 for calling the TestEvalModel obj's underlying member method code with example usage: obj.test_multitasking_metrics_macro() without return types