def test_confustion_matrix(self): # Returns 2 true positives (TP) and 1 false positive (FP). v = metrics.confusion_matrix(lambda document: True, self.documents) self.assertEqual(v, (2,0,1,0)) # Returns 1 true negative (TN) and 2 false negatives (FN). v = metrics.confusion_matrix(lambda document: False, self.documents) self.assertEqual(v, (0,1,0,2))
def test_confustion_matrix(self): # Assert 2 true positives (TP) and 1 false positive (FP). v = metrics.confusion_matrix(lambda document: True, self.documents) self.assertEqual(v, (2,0,1,0)) # Assert 1 true negative (TN) and 2 false negatives (FN). v = metrics.confusion_matrix(lambda document: False, self.documents) self.assertEqual(v, (0,1,0,2)) print("pattern.metrics.confusion_matrix()" )
def test_confustion_matrix(self): # Assert 2 true positives (TP) and 1 false positive (FP). v = metrics.confusion_matrix(lambda document: True, self.documents) self.assertEqual(v, (2, 0, 1, 0)) # Assert 1 true negative (TN) and 2 false negatives (FN). v = metrics.confusion_matrix(lambda document: False, self.documents) self.assertEqual(v, (0, 1, 0, 2)) print("pattern.metrics.confusion_matrix()")