예제 #1
0
    def test_same_size(self):

        labels = np.array([1, 0, 0, 1, 0, 1, 1, 0])
        expected = np.array([0, 1, 2, 3, 4, 5, 6, 7])

        actual = evaluation.fifty_fifty_split(np.array(labels))
        assert_array_equal(expected, actual)
예제 #2
0
    def test_fewer_1(self):

        np.random.seed(1234)  # "expected" below only valid for this seed

        labels = np.array([1, 0, 0, 0, 0, 1, 0, 1])
        expected = np.array([0, 1, 2, 5, 6, 7])

        actual = evaluation.fifty_fifty_split(np.array(labels))
        assert_array_equal(expected, actual)
예제 #3
0
 def test_no_1(self):
     labels = np.array([0, 0, 0, 0, 0, 0, 0, 0])
     evaluation.fifty_fifty_split(np.array(labels))
예제 #4
0
 def test_no_0(self):
     labels = np.array([1, 1, 1, 1, 1, 1, 1, 1])
     evaluation.fifty_fifty_split(np.array(labels))