def test_to_dict(self): tail = NoTail() output_dict = tail.to_dict() assert "class" in output_dict assert output_dict["class"] == "NoTail" assert "params" in output_dict assert output_dict["params"] is None
def test_compute_b(self): tail = NoTail() y = np.random.rand(10) b = tail.compute_b(y) assert b.shape == (10, 1) assert np.all(b == y.reshape((-1, 1))) b = tail.compute_b(y, 2) assert b.shape == (10, 1) assert np.all(b == y.reshape((-1, 1)))
def test_evaluate(self): tail = NoTail() x = np.random.rand(10, 2) y = tail.evaluate(x) assert y.shape == (10, ) assert np.all(y == np.zeros(10)) x = np.random.rand(20, 2) y = tail.evaluate(x) assert y.shape == (20, ) assert np.all(y == np.zeros(20))
def test_compute_P(self): tail = NoTail() x = np.random.rand(10, 2) P = tail.compute_P(x) assert P is None
def test_degree(self): tail = NoTail() assert tail.degree == -1
def test_set_params(self): tail = NoTail() tail.set_params(1) assert True
def test_params(self): tail = NoTail() assert tail.params is None
def test___init__(self): tail = NoTail() assert True