MCPcopy Create free account
hub / github.com/antmachineintelligence/mtgbmcode / RecomputeMaxDepth

Method RecomputeMaxDepth

python-package/compile/src/io/tree.cpp:728–740  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

726}
727
728void Tree::RecomputeMaxDepth() {
729 if (num_leaves_ == 1) {
730 max_depth_ = 0;
731 } else {
732 if (leaf_depth_.size() == 0) {
733 RecomputeLeafDepths(0, 0);
734 }
735 max_depth_ = leaf_depth_[0];
736 for (int i = 1; i < num_leaves(); ++i) {
737 if (max_depth_ < leaf_depth_[i]) max_depth_ = leaf_depth_[i];
738 }
739 }
740}
741
742} // namespace LightGBM

Callers 1

InitPredictMethod · 0.45

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected