예제 #1
0
    def test_case_5(self):
        # Arrange
        ground_truth = np.array([1, 1, 0, 1, 1])
        predicted = np.array([1, 0, 1, 0, 0])

        # Act
        result = recall_binary(ground_truth, predicted)

        # Assert
        self.assertAlmostEqual(result, 1 / (1 + 3), places=8)
예제 #2
0
    def test_case_2_all_zeros(self):
        # Arrange
        ground_truth = np.array([0, 0, 0])
        predicted = np.array([0, 0, 0])

        # Act
        result = recall_binary(ground_truth, predicted)

        # Assert
        self.assertAlmostEqual(result, 0, places=8)