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

Method UpdateScore

src/boosting/gbdt.cpp:587–607  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

585}
586
587void GBDT::UpdateScore(const Tree* tree, const int cur_tree_id) {
588 // update training score
589 if (!is_use_subset_) {
590 train_score_updater_->AddScore(tree_learner_.get(), tree, cur_tree_id);
591
592 // we need to predict out-of-bag scores of data for boosting
593 if (num_data_ - bag_data_cnt_ > 0) {
594 train_score_updater_->AddScore(tree, bag_data_indices_.data() + bag_data_cnt_, num_data_ - bag_data_cnt_, cur_tree_id);
595 }
596
597 } else {
598 train_score_updater_->AddScore(tree, cur_tree_id);
599 }
600
601
602 // update validation score
603 for (auto& score_updater : valid_score_updater_) {
604// score_updater->AddScore(tree, 0);
605 score_updater->AddScore(tree, cur_tree_id);
606 }
607}
608
609std::vector<double> GBDT::EvalOneMetric(const Metric* metric, const double* score) const {
610 return metric->Eval(score, objective_function_);

Callers

nothing calls this directly

Calls 3

dataMethod · 0.80
AddScoreMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected