Revert "Fix #3485, #3540: Don't use dropout for predicting test sets" (#3563)

* Revert "Fix #3485, #3540: Don't use dropout for predicting test sets (#3556)"

This reverts commit 44811f2330.

* Document behavior of predict() for DART booster

* Add notice to parameter.rst
This commit is contained in:
Philip Hyunsu Cho
2018-08-08 09:48:55 -07:00
committed by GitHub
parent e3e776bd58
commit 3c72654e3b
9 changed files with 61 additions and 30 deletions

View File

@@ -48,13 +48,6 @@ class TestModels(unittest.TestCase):
preds2 = bst2.predict(dtest2, ntree_limit=num_round)
# assert they are the same
assert np.sum(np.abs(preds2 - preds)) == 0
# regression test for issues #3485, #3540
for _ in range(10):
bst3 = xgb.Booster(params=param, model_file='xgb.model.dart')
dtest3 = xgb.DMatrix('dtest.buffer')
preds3 = bst3.predict(dtest3)
# assert they are the same
assert np.sum(np.abs(preds3 - preds)) == 0, 'preds3 = {}, preds = {}'.format(preds3, preds)
# check whether sample_type and normalize_type work
num_round = 50