| 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, |
no test coverage detected