Unverified Commit 9d431d12 authored by Guolin Ke's avatar Guolin Ke Committed by GitHub
Browse files

typo fix (#3239)

parent 50560573
......@@ -165,8 +165,8 @@ Tree* SerialTreeLearner::Train(const score_t* gradients, const score_t *hessians
bool track_branch_features = !(config_->interaction_constraints_vector.empty());
auto tree = std::unique_ptr<Tree>(new Tree(config_->num_leaves, track_branch_features));
auto tree_prt = tree.get();
constraints_->ShareTreePointer(tree_prt);
auto tree_ptr = tree.get();
constraints_->ShareTreePointer(tree_ptr);
// root leaf
int left_leaf = 0;
......@@ -174,13 +174,13 @@ Tree* SerialTreeLearner::Train(const score_t* gradients, const score_t *hessians
// only root leaf can be splitted on first time
int right_leaf = -1;
int init_splits = ForceSplits(tree_prt, &left_leaf, &right_leaf, &cur_depth);
int init_splits = ForceSplits(tree_ptr, &left_leaf, &right_leaf, &cur_depth);
for (int split = init_splits; split < config_->num_leaves - 1; ++split) {
// some initial works before finding best split
if (BeforeFindBestSplit(tree_prt, left_leaf, right_leaf)) {
if (BeforeFindBestSplit(tree_ptr, left_leaf, right_leaf)) {
// find best threshold for every feature
FindBestSplits(tree_prt);
FindBestSplits(tree_ptr);
}
// Get a leaf with max split gain
int best_leaf = static_cast<int>(ArrayArgs<SplitInfo>::ArgMax(best_split_per_leaf_));
......@@ -192,7 +192,7 @@ Tree* SerialTreeLearner::Train(const score_t* gradients, const score_t *hessians
break;
}
// split tree with best leaf
Split(tree_prt, best_leaf, &left_leaf, &right_leaf);
Split(tree_ptr, best_leaf, &left_leaf, &right_leaf);
cur_depth = std::max(cur_depth, tree->leaf_depth(left_leaf));
}
Log::Debug("Trained a tree with leaves = %d and max_depth = %d", tree->num_leaves(), cur_depth);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment