Restore unknown data support. (#6595)

This commit is contained in:
Jiaming Yuan
2021-01-14 04:51:16 +08:00
committed by GitHub
parent 89a00a5866
commit d356b7a071
4 changed files with 36 additions and 22 deletions

View File

@@ -296,3 +296,12 @@ class TestDMatrix:
param = {'max_depth': 3, 'objective': 'binary:logistic', 'verbosity': 0}
bst = xgb.train(param, dtrain, 5, watchlist)
bst.predict(dtrain)
def test_unknown_data(self):
class Data:
pass
with pytest.raises(TypeError):
with pytest.warns(UserWarning):
d = Data()
xgb.DMatrix(d)