| 292 | } |
| 293 | |
| 294 | void VerifyPredictionWithLesserFeatures(Learner *learner, bst_idx_t kRows, |
| 295 | std::shared_ptr<DMatrix> m_test, |
| 296 | std::shared_ptr<DMatrix> m_invalid) { |
| 297 | HostDeviceVector<float> prediction; |
| 298 | Json config{Object()}; |
| 299 | learner->SaveConfig(&config); |
| 300 | |
| 301 | learner->Predict(m_test, false, &prediction, 0, 0); |
| 302 | ASSERT_EQ(prediction.Size(), kRows); |
| 303 | |
| 304 | ASSERT_THROW({ learner->Predict(m_invalid, false, &prediction, 0, 0); }, dmlc::Error); |
| 305 | } |
| 306 | |
| 307 | } // anonymous namespace |
| 308 |
no test coverage detected