def test_lines_intersection(self): a = np.array([1, 0]) b = np.array([2, -1]) # create data with four instances and three features x = np.array([[2, 4, 4], [1, 2, 2], [0, -1, 2], [1, 2, 2]]) y = np.array([[-2, 0, 1], [-1, 0, 1], [0, -1, 0], [-0.01, 0, 3]]) table = np.array([np.vstack((x[:, i], y[:, i])).T for i in range(y.shape[1])]) i = line_intersects_profiles(a, b, table) np.testing.assert_array_equal(np.array([False, True, True, True]), i)
def test_lines_intersection(self): a = np.array([1, 0]) b = np.array([2, -1]) # create data with four instances and three features x = np.array([[2, 4, 4], [1, 2, 2], [0, -1, 2], [1, 2, 2]]) y = np.array([[-2, 0, 1], [-1, 0, 1], [0, -1, 0], [-0.01, 0, 3]]) table = np.array([np.vstack((x[:, i], y[:, i])).T for i in range(y.shape[1])]) i = line_intersects_profiles(a, b, table) np.testing.assert_array_equal(np.array([False, True, True, True]), i)