code: def test_results(self):
      # empty MeanEvaluation
      e = MeanEvaluation([])
      self.assertEqual(e.num_tp, 0)
      self.assertEqual(e.num_fp, 0)
      self.assertEqual(e.num_tn, 0)
      self.assertEqual(e.num_fn, 0)
      self.assertEqual(e.num_annotations, 0)
      self.assertTrue(math.isnan(e.precision))
      self.assertTrue(math.isnan(e.recall))
      self.assertTrue(math.isnan(e.fmeasure))
      self.assertTrue(math.isnan(e.accuracy))
      self.assertEqual(len(e), 0)
      # empty SimpleEvaluation
      e = MeanEvaluation([SimpleEvaluation()])
      self.assertEqual(e.num_tp, 0)
      self.assertEqual(e.num_fp, 0)
      self.assertEqual(e.num_tn, 0)
      self.assertEqual(e.num_fn, 0)
      self.assertEqual(e.num_annotations, 0)
      self.assertEqual(e.precision, 1)
      self.assertEqual(e.recall, 1)
      self.assertEqual(e.fmeasure, 1)
      self.assertEqual(e.accuracy, 1)
      self.assertEqual(len(e), 1)
      # empty SimpleEvaluation without the list
      e = MeanEvaluation(SimpleEvaluation())
      self.assertEqual(e.num_tp, 0)
      self.assertEqual(e.num_fp, 0)
      self.assertEqual(e.num_tn, 0)
      self.assertEqual(e.num_fn, 0)
      self.assertEqual(e.num_annotations, 0)
      self.assertEqual(e.precision, 1)
      self.assertEqual(e.recall, 1)
      self.assertEqual(e.fmeasure, 1)
      self.assertEqual(e.accuracy, 1)
      self.assertEqual(len(e), 1)
      # empty and real SimpleEvaluation
      e1 = SimpleEvaluation()
      e2 = SimpleEvaluation(num_tp=5, num_fp=3, num_tn=4, num_fn=1)
      e = MeanEvaluation([e1, e2])
      self.assertEqual(e.num_tp, 5 / 2.0)
      self.assertEqual(e.num_fp, 3 / 2.0)
      self.assertEqual(e.num_tn, 4 / 2.0)
      self.assertEqual(e.num_fn, 1 / 2.0)
      self.assertEqual(e.num_annotations, 6 / 2.0)
      self.assertEqual(e.precision, (1 + 5.0 / 8.0) / 2.0)
      self.assertEqual(e.recall, (1 + 5.0 / 6.0) / 2.0)
      f = (
          1
          + 2 * (5.0 / 8.0) * (5.0 / 6.0) / ((5.0 / 8.0) + (5.0 / 6.0))
      ) / 2.0
      self.assertEqual(e.fmeasure, f)
      self.assertEqual(
          e.accuracy, (1 + (5.0 + 4) / (5 + 3 + 4 + 1)) / 2.0
      )
      self.assertEqual(len(e), 2)
  
imports: from __future__ import absolute_import, division, print_function
  import math
  import unittest
  from collections import OrderedDict
  from madmom.evaluation import *
label_desc: Use image node_id 2 for calling the TestMeanEvaluationClass obj's underlying member method code with example usage: obj.test_results() without return types