Validate weights are positive values. (#6115)

This commit is contained in:
Jiaming Yuan
2020-09-15 09:03:55 +08:00
committed by GitHub
parent c6f2b8c841
commit b5f52f0b1b
6 changed files with 15 additions and 9 deletions

View File

@@ -135,7 +135,7 @@ class TestModin(unittest.TestCase):
X = np.random.randn(kRows, kCols)
y = np.random.randn(kRows)
w = np.random.randn(kRows).astype(np.float32)
w = np.random.uniform(size=kRows).astype(np.float32)
w_pd = md.DataFrame(w)
data = xgb.DMatrix(X, y, w_pd)

View File

@@ -151,7 +151,7 @@ class TestPandas(unittest.TestCase):
X = np.random.randn(kRows, kCols)
y = np.random.randn(kRows)
w = np.random.randn(kRows).astype(np.float32)
w = np.random.uniform(size=kRows).astype(np.float32)
w_pd = pd.DataFrame(w)
data = xgb.DMatrix(X, y, w_pd)