| 372 | } |
| 373 | |
| 374 | void GBTreeModelForTest(gbm::GBTreeModel *model, uint32_t split_ind, bst_cat_t split_cat, |
| 375 | float left_weight, float right_weight) { |
| 376 | PredictionCacheEntry out_predictions; |
| 377 | |
| 378 | std::vector<std::unique_ptr<RegTree>> trees; |
| 379 | trees.push_back(std::unique_ptr<RegTree>(new RegTree)); |
| 380 | auto &p_tree = trees.front(); |
| 381 | |
| 382 | std::vector<uint32_t> split_cats(LBitField32::ComputeStorageSize(split_cat)); |
| 383 | LBitField32 cats_bits(split_cats); |
| 384 | cats_bits.Set(split_cat); |
| 385 | |
| 386 | p_tree->ExpandCategorical(0, split_ind, split_cats, true, 1.5f, left_weight, right_weight, 3.0f, |
| 387 | 2.2f, 7.0f, 9.0f); |
| 388 | model->CommitModelGroup(std::move(trees), 0); |
| 389 | } |
| 390 | |
| 391 | void TestCategoricalPrediction(bool use_gpu, bool is_column_split) { |
| 392 | Context ctx; |
no test coverage detected