Skip to content

Commit

Permalink
Update gbdt.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
guolinke committed Aug 1, 2017
1 parent f5aa1c9 commit 399710a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/boosting/gbdt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ GBDT::GBDT()
num_threads_ = omp_get_num_threads();
}
average_output_ = false;
tree_learner_ = nullptr;
}

GBDT::~GBDT() {
Expand Down Expand Up @@ -217,13 +218,12 @@ void GBDT::ResetTrainingData(const Dataset* train_data, const ObjectiveFunction*

void GBDT::ResetConfig(const BoostingConfig* config) {
auto new_config = std::unique_ptr<BoostingConfig>(new BoostingConfig(*config));

early_stopping_round_ = new_config->early_stopping_round;
shrinkage_rate_ = new_config->learning_rate;

ResetBaggingConfig(new_config.get());

tree_learner_->ResetConfig(&new_config->tree_config);
if (tree_learner_ != nullptr) {
ResetBaggingConfig(new_config.get());
tree_learner_->ResetConfig(&new_config->tree_config);
}
gbdt_config_.reset(new_config.release());
}

Expand Down

0 comments on commit 399710a

Please sign in to comment.