Esempio n. 1
0
 def test_properties(self):
     c = ConfusionMatrix([[1, 2], [3, 4]])
     cn = c.normalise()
     self.assertEqual(c.num_classes, 2)
     self.assertEqual(c.total, 10)
     self.assertEqual(cn.total, 1)
Esempio n. 2
0
 def test_normalise(self):
     c = ConfusionMatrix([[1, 2], [3, 4]])
     cn = c.normalise()
     self.assertTrue(
         np.all(cn.asarray() == np.array([[0.1, 0.2], [0.3, 0.4]])))