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

Method ResetTrainingData

src/boosting/rf.hpp:65–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63 }
64
65 void ResetTrainingData(const Dataset* train_data, const ObjectiveFunction* objective_function,
66 const std::vector<const Metric*>& training_metrics) override {
67 GBDT::ResetTrainingData(train_data, objective_function, training_metrics);
68 if (iter_ + num_init_iteration_ > 0) {
69 for (int cur_tree_id = 0; cur_tree_id < num_tree_per_iteration_; ++cur_tree_id) {
70 train_score_updater_->MultiplyScore(1.0f / (iter_ + num_init_iteration_), cur_tree_id);
71 }
72 }
73 CHECK(num_tree_per_iteration_ == num_class_);
74 // only boosting one time
75 Boosting();
76 if (is_use_subset_ && bag_data_cnt_ < num_data_) {
77 tmp_grad_.resize(num_data_);
78 tmp_hess_.resize(num_data_);
79 }
80 }
81
82 void Boosting() override {
83 if (objective_function_ == nullptr) {

Callers

nothing calls this directly

Calls 3

BoostingFunction · 0.50
MultiplyScoreMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected