def covariates(X): """ This 1. checks if the lower-level covariate contains a constant 2. adds a constant to the lower-level covariate if it has no constant """ if constant_check(X): Warn("X array should not contain a constant vector;" " constant will be added automatically") else: X = sphstack(np.ones((X.shape[0], 1)), X) return X
def test_constant_check(self): obs = diagnostics.constant_check(reg.x) exp = True self.assertEquals(obs,exp)
def test_constant_check(self): obs = diagnostics.constant_check(reg.x) exp = True self.assertEquals(obs, exp)
def test_constant_check(self): obs = diagnostics.constant_check(reg.x) exp = True np.testing.assert_equal(obs, exp)
def test_constant_check(self): obs = diagnostics.constant_check(reg.x) exp = True np.testing.assert_equal(obs,exp)