diff --git a/src/boosting/boosting.cpp b/src/boosting/boosting.cpp index 03dbe631652b..97315d2acac8 100644 --- a/src/boosting/boosting.cpp +++ b/src/boosting/boosting.cpp @@ -48,11 +48,11 @@ Boosting* Boosting::CreateBoosting(const std::string& type, const char* filename } else if (type == std::string("goss")) { ret.reset(new GOSS()); } else { - Log::Fatal("unknow boosting type %s", type.c_str()); + Log::Fatal("unknown boosting type %s", type.c_str()); } LoadFileToBoosting(ret.get(), filename); } else { - Log::Fatal("unknow submodel type in model file %s", filename); + Log::Fatal("unknown submodel type in model file %s", filename); } return ret.release(); } @@ -64,7 +64,7 @@ Boosting* Boosting::CreateBoosting(const char* filename) { if (type == std::string("tree")) { ret.reset(new GBDT()); } else { - Log::Fatal("unknow submodel type in model file %s", filename); + Log::Fatal("unknown submodel type in model file %s", filename); } LoadFileToBoosting(ret.get(), filename); return ret.release(); diff --git a/src/boosting/dart.hpp b/src/boosting/dart.hpp index 847de075f6a1..717749110d20 100644 --- a/src/boosting/dart.hpp +++ b/src/boosting/dart.hpp @@ -84,7 +84,7 @@ class DART: public GBDT { void DroppingTrees() { drop_index_.clear(); bool is_skip = random_for_drop_.NextFloat() < gbdt_config_->skip_drop; - // select dropping tree indexes based on drop_rate and tree weights + // select dropping tree indices based on drop_rate and tree weights if (!is_skip) { double drop_rate = gbdt_config_->drop_rate; if (!gbdt_config_->uniform_drop) { @@ -180,7 +180,7 @@ class DART: public GBDT { std::vector tree_weight_; /*! \brief sum weights of all trees */ double sum_weight_; - /*! \brief The indexes of dropping trees */ + /*! \brief The indices of dropping trees */ std::vector drop_index_; /*! \brief Random generator, used to select dropping trees */ Random random_for_drop_; diff --git a/src/boosting/gbdt.cpp b/src/boosting/gbdt.cpp index 43b1f58e1981..d18432ca27ab 100644 --- a/src/boosting/gbdt.cpp +++ b/src/boosting/gbdt.cpp @@ -370,7 +370,7 @@ bool GBDT::TrainOneIter(const score_t* gradient, const score_t* hessian, bool is #ifdef TIMETAG start_time = std::chrono::steady_clock::now(); #endif - std::unique_ptr new_tree(new Tree(2)); + std::unique_ptr new_tree; // train a new tree new_tree.reset(tree_learner_->Train(gradient + curr_class * num_data_, hessian + curr_class * num_data_)); #ifdef TIMETAG diff --git a/src/boosting/gbdt.h b/src/boosting/gbdt.h index 742ed52dea2e..c93a30751b38 100644 --- a/src/boosting/gbdt.h +++ b/src/boosting/gbdt.h @@ -26,11 +26,10 @@ class GBDT: public Boosting { ~GBDT(); /*! * \brief Initialization logic - * \param config Config for boosting + * \param gbdt_config Config for boosting * \param train_data Training data * \param object_function Training objective function * \param training_metrics Training metrics - * \param output_model_filename Filename of output model */ void Init(const BoostingConfig* gbdt_config, const Dataset* train_data, const ObjectiveFunction* object_function, const std::vector& training_metrics) @@ -267,7 +266,6 @@ class GBDT: public Boosting { std::string OutputMetric(int iter); /*! * \brief Calculate feature importances - * \param last_iter Last tree use to calculate */ std::vector> FeatureImportance() const; /*! \brief current iteration */