"include/git@developer.sourcefind.cn:tianlh/lightgbm-dcu.git" did not exist on "aab8fc18a259ca9ca95db5bac203b81cb2e1ad49"
Commit 97995dcf authored by Guolin Ke's avatar Guolin Ke
Browse files

fix tests.

parent 5e1a5135
...@@ -41,7 +41,8 @@ GBDT::GBDT() ...@@ -41,7 +41,8 @@ GBDT::GBDT()
num_iteration_for_pred_(0), num_iteration_for_pred_(0),
shrinkage_rate_(0.1f), shrinkage_rate_(0.1f),
num_init_iteration_(0), num_init_iteration_(0),
boost_from_average_(false) { boost_from_average_(false),
need_re_bagging_(false) {
#pragma omp parallel #pragma omp parallel
#pragma omp master #pragma omp master
{ {
...@@ -259,16 +260,15 @@ void GBDT::ResetBaggingConfig(const BoostingConfig* config, bool is_change_datas ...@@ -259,16 +260,15 @@ void GBDT::ResetBaggingConfig(const BoostingConfig* config, bool is_change_datas
is_use_subset_ = true; is_use_subset_ = true;
Log::Debug("use subset for bagging"); Log::Debug("use subset for bagging");
} }
if (is_change_dataset) {
need_re_bagging_ = true;
}
} else { } else {
bag_data_cnt_ = num_data_; bag_data_cnt_ = num_data_;
bag_data_indices_.clear(); bag_data_indices_.clear();
tmp_indices_.clear(); tmp_indices_.clear();
is_use_subset_ = false; is_use_subset_ = false;
} }
if (is_change_dataset) {
need_re_bagging_ = true;
}
} }
void GBDT::AddValidDataset(const Dataset* valid_data, void GBDT::AddValidDataset(const Dataset* valid_data,
......
...@@ -388,7 +388,7 @@ protected: ...@@ -388,7 +388,7 @@ protected:
bool is_constant_hessian_; bool is_constant_hessian_;
std::unique_ptr<ObjectiveFunction> loaded_objective_; std::unique_ptr<ObjectiveFunction> loaded_objective_;
bool average_output_; bool average_output_;
bool need_re_bagging_ = false; bool need_re_bagging_;
}; };
} // namespace LightGBM } // namespace LightGBM
......
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