MCPcopy Create free account
hub / github.com/dmlc/xgboost / BoostOneIter

Method BoostOneIter

src/learner.cc:1136–1157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1134 }
1135
1136 void BoostOneIter(std::int32_t, std::shared_ptr<DMatrix> train,
1137 GradientContainer* in_gpair) override {
1138 this->monitor_.Start(__func__);
1139 this->Configure();
1140
1141 if (ctx_.seed_per_iteration) {
1142 ctx_.Rng().seed(ctx_.seed * kRandSeedMagic + this->BoostedRounds());
1143 }
1144
1145 this->ValidateDMatrix(train.get(), true);
1146 if (in_gpair->HasValueGrad()) {
1147 CHECK_EQ(this->learner_model_param_.OutputLength(), in_gpair->NumTargets())
1148 << "Value gradient should have the same number of targets as the overall model.";
1149 } else {
1150 CHECK_EQ(this->learner_model_param_.OutputLength(), in_gpair->NumSplitTargets())
1151 << "The number of columns in gradient should be equal to the number of "
1152 "targets/classes in the model.";
1153 }
1154 auto predt = prediction_container_.Cache(train, ctx_.Device());
1155 this->gbm_->DoBoost(train.get(), in_gpair, predt.get(), obj_.get());
1156 this->monitor_.Stop(__func__);
1157 }
1158
1159 std::string EvalOneIter(int iter, const std::vector<std::shared_ptr<DMatrix>>& data_sets,
1160 const std::vector<std::string>& data_names) override {

Callers 3

XGBoosterTrainOneIterFunction · 0.80
TESTFunction · 0.80

Calls 13

BoostedRoundsMethod · 0.95
ValidateDMatrixMethod · 0.95
HasValueGradMethod · 0.80
StartMethod · 0.45
ConfigureMethod · 0.45
getMethod · 0.45
OutputLengthMethod · 0.45
NumTargetsMethod · 0.45
NumSplitTargetsMethod · 0.45
CacheMethod · 0.45
DeviceMethod · 0.45
DoBoostMethod · 0.45

Tested by 1

TESTFunction · 0.64