def test_index_intervals(self):
f = fe.IntervalFeatureExtractor.index_intervals
ys = [2, 4, 12, 17]
ye = [2, 8, 15, 18]
x = []
expect = []
result = f(x, ys, ye)
npt.assert_array_equal(result, expect)
x = [-1, 3, 9, 19]
expect = [-1, -1, -1, -1]
result = f(x, ys, ye)
npt.assert_array_equal(result, expect)
x = [-1, 2, 2, 3, 4, 8, 15, 16]
expect = [-1, 0, 0, -1, 1, 1, 2, -1]
result = f(x, ys, ye)
npt.assert_array_equal(result, expect)
评论列表
文章目录