code: def test_results(self):
      # empty detections / annotations
      e = NoteEvaluation([[]], [[]])
      self.assertTrue(np.allclose(e.tp, np.zeros((0, 2))))
      self.assertTrue(np.allclose(e.fp, np.zeros((0, 2))))
      self.assertTrue(np.allclose(e.tn, np.zeros((0, 2))))
      self.assertTrue(np.allclose(e.fn, np.zeros((0, 2))))
      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.precision, 1)
      self.assertEqual(e.recall, 1)
      self.assertEqual(e.fmeasure, 1)
      self.assertEqual(e.accuracy, 1)
      self.assertTrue(np.allclose(e.errors, np.zeros((0, 2))))
      self.assertTrue(math.isnan(e.mean_error))
      self.assertTrue(math.isnan(e.std_error))
  
      # real detections / annotations
      e = NoteEvaluation(DETECTIONS, ANNOTATIONS)
      self.assertTrue(
          np.allclose(
              e.tp, [[0.147, 72], [2.540, 77], [3.368, 75], [3.449, 43]]
          )
      )
      self.assertTrue(
          np.allclose(e.fp, [[0.147, 60], [0.147, 80], [2.520, 60]])
      )
      self.assertTrue(np.allclose(e.tn, np.zeros((0, 2))))
      self.assertTrue(
          np.allclose(
              e.fn, [[1.567, 41], [2.549, 60], [2.563, 65], [2.577, 56]]
          )
      )
      self.assertEqual(e.num_tp, 4)
      self.assertEqual(e.num_fp, 3)
      self.assertEqual(e.num_tn, 0)
      self.assertEqual(e.num_fn, 4)
      self.assertEqual(e.precision, 4.0 / 7.0)
      self.assertEqual(e.recall, 4.0 / 8.0)
      f = 2 * (4.0 / 7.0) * (4.0 / 8.0) / ((4.0 / 7.0) + (4.0 / 8.0))
      self.assertEqual(e.fmeasure, f)
      self.assertEqual(e.accuracy, (4.0 + 0) / (4 + 3 + 0 + 4))
      # errors
      # tp =  [[0.147, 72], [2.540, 77], [3.368, 75], [3.449, 43]]
      # ann = [[0.147, 72], [2.526, 77], [3.369, 75], [3.449, 43]]
      # err = [[0.   , 72], [0.014, 77], [-0.001, 75], [0.   , 43]]
      errors = np.asarray(
          [[0.0, 72], [0.014, 77], [-0.001, 75], [0.0, 43]]
      )
      self.assertTrue(np.allclose(e.errors, errors))
      self.assertTrue(
          np.allclose(e.mean_error, np.mean([0, 0.014, -0.001, 0]))
      )
      self.assertTrue(
          np.allclose(e.std_error, np.std([0, 0.014, -0.001, 0]))
      )
  
imports: from __future__ import absolute_import, division, print_function
  import math
  import unittest
  from madmom.evaluation.notes import *
  from .None import ANNOTATIONS_PATH, DETECTIONS_PATH
label_desc: Use image node_id 3 for calling the TestNoteEvaluationClass obj's underlying member method code with example usage: obj.test_results() without return types