| 300 | protected: |
| 301 | ~SerializationTest() override = default; |
| 302 | void SetUp() override { |
| 303 | p_dmat_ = RandomDataGenerator(kRows, kCols, .5f).GenerateDMatrix(); |
| 304 | |
| 305 | p_dmat_->Info().labels.Reshape(kRows); |
| 306 | auto& h_labels = p_dmat_->Info().labels.Data()->HostVector(); |
| 307 | |
| 308 | xgboost::SimpleLCG gen(0); |
| 309 | SimpleRealUniformDistribution<float> dis(0.0f, 1.0f); |
| 310 | |
| 311 | for (auto& v : h_labels) { |
| 312 | v = dis(&gen); |
| 313 | } |
| 314 | |
| 315 | for (size_t i = 0; i < kCols; ++i) { |
| 316 | std::string name = "feat_" + std::to_string(i); |
| 317 | fmap_.PushBack(i, name.c_str(), "q"); |
| 318 | } |
| 319 | } |
| 320 | }; |
| 321 | |
| 322 | size_t constexpr SerializationTest::kRows; |
nothing calls this directly
no test coverage detected