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

Function TestPredictionWithLesserFeatures

tests/cpp/predictor/test_predictor.cc:309–316  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

307} // anonymous namespace
308
309void TestPredictionWithLesserFeatures(Context const *ctx) {
310 size_t constexpr kRows = 256, kTrainCols = 256, kTestCols = 4, kIters = 4;
311 auto m_train = RandomDataGenerator(kRows, kTrainCols, 0.5).GenerateDMatrix(true);
312 auto learner = LearnerForTest(ctx, m_train, kIters);
313 auto m_test = RandomDataGenerator(kRows, kTestCols, 0.5).GenerateDMatrix(false);
314 auto m_invalid = RandomDataGenerator(kRows, kTrainCols + 1, 0.5).GenerateDMatrix(false);
315 VerifyPredictionWithLesserFeatures(learner.get(), kRows, m_test, m_invalid);
316}
317
318void TestPredictionDeviceAccess() {
319 Context ctx;

Callers 2

TESTFunction · 0.85
TESTFunction · 0.85

Calls 5

RandomDataGeneratorClass · 0.85
LearnerForTestFunction · 0.85
GenerateDMatrixMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected