Пример #1
0
def test_over_half_wrong_switches_classes():
    xs = ones
    half = len(ones) // 2
    for i in range(half):
        num_wrong = i + half
        ys = xs.copy()
        ys[0:num_wrong] = 0
        assert(to_test.matches(xs, ys) == half + i)
Пример #2
0
def assert_wrong(num_wrong):
    xs = ones
    ys = xs.copy()
    ys[0:num_wrong] = 0
    assert(to_test.matches(xs, ys) == len(xs) - num_wrong)
Пример #3
0
def test_both_zeros_is_valid():
    assert(to_test.matches(zeros, zeros) == len(zeros))
Пример #4
0
def test_matching_exactly_opposite_interleaved():
    xs = interleave(ones, zeros)
    ys = interleave(ones, zeros)
    assert(to_test.matches(xs, ys) == n + m)
Пример #5
0
def test_matching_exactly_matching():
    ys = np.hstack([zeros, ones])
    xs = np.hstack([zeros, ones])
    assert(to_test.matches(xs, ys) == n + m)
Пример #6
0
def test_matching_exactly_opposite():
    xs = np.hstack([ones, zeros])
    ys = np.hstack([zeros, ones])
    assert(to_test.matches(xs, ys) == n + m)