Exemplo n.º 1
0
 def test_add(self):
     c1 = ConfusionMatrix([[1, 2], [3, 4]])
     c2 = ConfusionMatrix([[3, 4], [1, 2]])
     s = c1 + c2
     t = ConfusionMatrix([[4, 6], [4, 6]])
     self.assertTrue(np.all(s.asarray() == t.asarray()))
Exemplo n.º 2
0
 def test_asarray(self):
     c = ConfusionMatrix([[1, 2], [3, 4]])
     self.assertTrue(np.all(c.asarray() == np.array([[1, 2], [3, 4]])))