Skip to content
Snippets Groups Projects
Unverified Commit a93287bf authored by Frank Sauerburger's avatar Frank Sauerburger
Browse files

Test invariance of confusion_matrix arguments

parent f6a9be9d
No related branches found
No related tags found
Loading
Checking pipeline status
......@@ -132,6 +132,30 @@ class SurvivalTestCase(unittest.TestCase):
annot=True)
self.assertIsNotNone(data)
def test_confusion_matrix_argument_reverse(self):
"""
Check that confusion_matrix does not change the arguments.
"""
df = pd.DataFrame({
"sick": [0, 1, 1, 0, 0],
"positive": [0, 0, 1, 1, 0],
"weight": [1, 1, 1, 1.7, 1],
})
positive = Cut(lambda d: d.positive == 1, label="+")
negative = Cut(lambda d: d.positive == 0, label="-")
sick = Cut(lambda d: d.sick == 1, label="sick")
healthy = Cut(lambda d: d.sick == 0, label="healthy")
x = [positive, negative]
y = [sick, healthy]
confusion_matrix(df, x, y, "Test result", "Truth",
weight=Variable("weight", "weight"))
self.assertEqual(x, [positive, negative])
self.assertEqual(y, [sick, healthy])
def test_atlasify(self):
"""
Check that calling atlasify() does not raise an error.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment