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

Method GetEvalAt

python-package/compile/src/boosting/gbdt.cpp:674–694  ·  view source on GitHub ↗

! \brief Get eval result */

Source from the content-addressed store, hash-verified

672
673/*! \brief Get eval result */
674std::vector<double> GBDT::GetEvalAt(int data_idx) const {
675 CHECK(data_idx >= 0 && data_idx <= static_cast<int>(valid_score_updater_.size()));
676 std::vector<double> ret;
677 if (data_idx == 0) {
678 for (auto& sub_metric : training_metrics_) {
679 auto scores = EvalOneMetric(sub_metric, train_score_updater_->score());
680 for (auto score : scores) {
681 ret.push_back(score);
682 }
683 }
684 } else {
685 auto used_idx = data_idx - 1;
686 for (size_t j = 0; j < valid_metrics_[used_idx].size(); ++j) {
687 auto test_scores = EvalOneMetric(valid_metrics_[used_idx][j], valid_score_updater_[used_idx]->score());
688 for (auto score : test_scores) {
689 ret.push_back(score);
690 }
691 }
692 }
693 return ret;
694}
695
696/*! \brief Get training scores result */
697const double* GBDT::GetTrainingScore(int64_t* out_len) {

Callers 1

LGBM_BoosterGetEvalFunction · 0.45

Calls 3

push_backMethod · 0.80
sizeMethod · 0.45
scoreMethod · 0.45

Tested by

no test coverage detected