Clean up training code. (#3825)

* Remove GHistRow, GHistEntry, GHistIndexRow.
* Remove kSimpleStats.
* Remove CheckInfo, SetLeafVec in GradStats and in SKStats.
* Clean up the GradStats.
* Cleanup calcgain.
* Move LossChangeMissing out of common.
* Remove [] operator from GHistIndexBlock.
This commit is contained in:
Jiaming Yuan
2019-02-07 14:22:13 +08:00
committed by GitHub
parent 325b16bccd
commit 017c97b8ce
19 changed files with 306 additions and 406 deletions

View File

@@ -57,10 +57,10 @@ class QuantileHistMock : public QuantileHistMaker {
{0.26f, 0.27f}, {0.23f, 0.24f}, {0.27f, 0.28f},
{0.57f, 0.59f}, {0.23f, 0.24f}, {0.47f, 0.49f}};
for (size_t i = 0; i < hist_[nid].size; ++i) {
for (size_t i = 0; i < hist_[nid].size(); ++i) {
GradientPairPrecise sol = solution[i];
ASSERT_NEAR(sol.GetGrad(), hist_[nid].begin[i].sum_grad, kEps);
ASSERT_NEAR(sol.GetHess(), hist_[nid].begin[i].sum_hess, kEps);
ASSERT_NEAR(sol.GetGrad(), hist_[nid][i].GetGrad(), kEps);
ASSERT_NEAR(sol.GetHess(), hist_[nid][i].GetHess(), kEps);
}
}