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

Method ValidateDMatrix

src/learner.cc:1298–1318  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1296 }
1297
1298 void ValidateDMatrix(DMatrix* p_fmat, bool is_training) const {
1299 MetaInfo const& info = p_fmat->Info();
1300 info.Validate(ctx_.Device());
1301
1302 if (is_training) {
1303 CHECK_EQ(learner_model_param_.num_feature, p_fmat->Info().num_col_)
1304 << "Number of columns does not match number of features in "
1305 "booster.";
1306 } else {
1307 CHECK_GE(learner_model_param_.num_feature, p_fmat->Info().num_col_)
1308 << "Number of columns does not match number of features in "
1309 "booster.";
1310 }
1311
1312 if (p_fmat->Info().num_row_ == 0) {
1313 error::WarnEmptyDataset();
1314 }
1315 if (!p_fmat->Info().base_margin_.Empty()) {
1316 CHECK_EQ(p_fmat->Info().base_margin_.Shape(1), this->mparam_.OutputLength());
1317 }
1318 }
1319
1320 private:
1321 void GetGradient(HostDeviceVector<float> const& preds, MetaInfo const& info, std::int32_t iter,

Callers 4

UpdateOneIterMethod · 0.95
BoostOneIterMethod · 0.95
EvalOneIterMethod · 0.95
PredictRawMethod · 0.95

Calls 7

WarnEmptyDatasetFunction · 0.85
ShapeMethod · 0.80
InfoMethod · 0.45
ValidateMethod · 0.45
DeviceMethod · 0.45
EmptyMethod · 0.45
OutputLengthMethod · 0.45

Tested by

no test coverage detected