Update documents and tests. (#7659)

* Revise documents after recent refactoring and cat support.
* Add tests for behavior of max_depth and max_leaves.
This commit is contained in:
Jiaming Yuan
2022-02-26 03:57:47 +08:00
committed by GitHub
parent 5eed2990ad
commit 18a4af63aa
7 changed files with 142 additions and 44 deletions

View File

@@ -174,6 +174,8 @@ class ColMaker: public TreeUpdater {
std::vector<int> newnodes;
this->InitData(gpair, *p_fmat);
this->InitNewNode(qexpand_, gpair, *p_fmat, *p_tree);
// We can check max_leaves too, but might break some grid searching pipelines.
CHECK_GT(param_.max_depth, 0) << "exact tree method doesn't support unlimited depth.";
for (int depth = 0; depth < param_.max_depth; ++depth) {
this->FindSplit(depth, qexpand_, gpair, p_fmat, p_tree);
this->ResetPosition(qexpand_, p_fmat, *p_tree);