[Breaking] Set output margin to True for custom objective. (#5564)

* Set output margin to True for custom objective in Python and R.

* Add a demo for writing multi-class custom objective function.

* Run tests on selected demos.
This commit is contained in:
Jiaming Yuan
2020-04-20 20:44:12 +08:00
committed by GitHub
parent fcbedcedf8
commit 9c1103e06c
10 changed files with 262 additions and 22 deletions

View File

@@ -295,6 +295,9 @@ void GBTree::BoostNewTrees(HostDeviceVector<GradientPair>* gpair,
}
}
// update the trees
CHECK_EQ(gpair->Size(), p_fmat->Info().num_row_)
<< "Mismatching size between number of rows from input data and size of "
"gradient vector.";
for (auto& up : updaters_) {
up->Update(gpair, p_fmat, new_trees);
}