* Fix #3485, #3540: Don't use dropout for predicting test sets Dropout (for DART) should only be used at training time. * Add regression test
This commit is contained in:
committed by
GitHub
parent
109473dae2
commit
44811f2330
@@ -103,6 +103,7 @@ class GBLinear : public GradientBooster {
|
||||
|
||||
void PredictBatch(DMatrix *p_fmat,
|
||||
HostDeviceVector<bst_float> *out_preds,
|
||||
bool dropout,
|
||||
unsigned ntree_limit) override {
|
||||
monitor_.Start("PredictBatch");
|
||||
CHECK_EQ(ntree_limit, 0U)
|
||||
|
||||
@@ -217,6 +217,7 @@ class GBTree : public GradientBooster {
|
||||
|
||||
void PredictBatch(DMatrix* p_fmat,
|
||||
HostDeviceVector<bst_float>* out_preds,
|
||||
bool dropout,
|
||||
unsigned ntree_limit) override {
|
||||
predictor_->PredictBatch(p_fmat, out_preds, model_, 0, ntree_limit);
|
||||
}
|
||||
@@ -356,8 +357,11 @@ class Dart : public GBTree {
|
||||
// predict the leaf scores with dropout if ntree_limit = 0
|
||||
void PredictBatch(DMatrix* p_fmat,
|
||||
HostDeviceVector<bst_float>* out_preds,
|
||||
bool dropout,
|
||||
unsigned ntree_limit) override {
|
||||
DropTrees(ntree_limit);
|
||||
if (dropout) {
|
||||
DropTrees(ntree_limit);
|
||||
}
|
||||
PredLoopInternal<Dart>(p_fmat, &out_preds->HostVector(), 0, ntree_limit, true);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user