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()))
def test_asarray(self): c = ConfusionMatrix([[1, 2], [3, 4]]) self.assertTrue(np.all(c.asarray() == np.array([[1, 2], [3, 4]])))