def test_process_confusion_matrix_with_zero(self):
        in_cm = pd.DataFrame({0: [2, 3, 5],
                              1: [2, 5, 7],
                              2: [1, 3, 6]},
                             index=[0, 1, 2])

        expected_out_cm = pd.DataFrame({'human 0': [2, 3, 5],
                                        'human 1': [2, 5, 7],
                                        'human 2': [1, 3, 6]},
                                       index=['machine 0', 'machine 1', 'machine 2'])

        out_cm = Comparer.process_confusion_matrix(in_cm)
        assert_frame_equal(out_cm, expected_out_cm)
    def test_process_confusion_matrix(self):
        in_cm = pd.DataFrame({1: [2, 3, 5],
                              2: [2, 5, 7],
                              3: [1, 3, 6]},
                             index=[1, 2, 3])

        expected_out_cm = pd.DataFrame({'human 1': [2, 3, 5],
                                        'human 2': [2, 5, 7],
                                        'human 3': [1, 3, 6]},
                                       index=['machine 1', 'machine 2', 'machine 3'])

        out_cm = Comparer.process_confusion_matrix(in_cm)
        assert_frame_equal(out_cm, expected_out_cm)
示例#3
0
    def test_process_confusion_matrix_with_zero(self):
        in_cm = pd.DataFrame({
            0: [2, 3, 5],
            1: [2, 5, 7],
            2: [1, 3, 6]
        },
                             index=[0, 1, 2])

        expected_out_cm = pd.DataFrame(
            {
                'human 0': [2, 3, 5],
                'human 1': [2, 5, 7],
                'human 2': [1, 3, 6]
            },
            index=['machine 0', 'machine 1', 'machine 2'])

        out_cm = Comparer.process_confusion_matrix(in_cm)
        assert_frame_equal(out_cm, expected_out_cm)
示例#4
0
    def test_process_confusion_matrix(self):
        in_cm = pd.DataFrame({
            1: [2, 3, 5],
            2: [2, 5, 7],
            3: [1, 3, 6]
        },
                             index=[1, 2, 3])

        expected_out_cm = pd.DataFrame(
            {
                'human 1': [2, 3, 5],
                'human 2': [2, 5, 7],
                'human 3': [1, 3, 6]
            },
            index=['machine 1', 'machine 2', 'machine 3'])

        out_cm = Comparer.process_confusion_matrix(in_cm)
        assert_frame_equal(out_cm, expected_out_cm)