| 196 | } |
| 197 | |
| 198 | RegTree ConstructTreeCat(std::vector<bst_cat_t>* cond) { |
| 199 | RegTree tree; |
| 200 | std::vector<uint32_t> cats_storage(common::CatBitField::ComputeStorageSize(33), 0); |
| 201 | common::CatBitField split_cats(cats_storage); |
| 202 | split_cats.Set(0); |
| 203 | split_cats.Set(14); |
| 204 | split_cats.Set(32); |
| 205 | |
| 206 | cond->push_back(0); |
| 207 | cond->push_back(14); |
| 208 | cond->push_back(32); |
| 209 | |
| 210 | tree.ExpandCategorical(0, /*split_index=*/0, cats_storage, true, 0.0f, 2.0, |
| 211 | 3.00, 11.0, 2.0, 3.0, 4.0); |
| 212 | auto left = tree[0].LeftChild(); |
| 213 | auto right = tree[0].RightChild(); |
| 214 | tree.ExpandNode( |
| 215 | /*nid=*/left, /*split_index=*/1, /*split_value=*/1.0f, |
| 216 | /*default_left=*/false, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, /*left_sum=*/0.0f, |
| 217 | /*right_sum=*/0.0f); |
| 218 | tree.ExpandCategorical(right, /*split_index=*/0, cats_storage, true, 0.0f, |
| 219 | 2.0, 3.00, 11.0, 2.0, 3.0, 4.0); |
| 220 | return tree; |
| 221 | } |
| 222 | |
| 223 | void TestCategoricalTreeDump(std::string format, std::string sep) { |
| 224 | std::vector<bst_cat_t> cond; |
no test coverage detected