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

Function ConstructTree

tests/cpp/tree/test_tree_model.cc:179–196  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

177
178namespace {
179RegTree ConstructTree() {
180 RegTree tree;
181 tree.ExpandNode(
182 /*nid=*/0, /*split_index=*/0, /*split_value=*/0.0f,
183 /*default_left=*/true, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, /*left_sum=*/0.0f,
184 /*right_sum=*/0.0f);
185 auto left = tree[0].LeftChild();
186 auto right = tree[0].RightChild();
187 tree.ExpandNode(
188 /*nid=*/left, /*split_index=*/1, /*split_value=*/1.0f,
189 /*default_left=*/false, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, /*left_sum=*/0.0f,
190 /*right_sum=*/0.0f);
191 tree.ExpandNode(
192 /*nid=*/right, /*split_index=*/2, /*split_value=*/2.0f,
193 /*default_left=*/false, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, /*left_sum=*/0.0f,
194 /*right_sum=*/0.0f);
195 return tree;
196}
197
198RegTree ConstructTreeCat(std::vector<bst_cat_t>* cond) {
199 RegTree tree;

Callers 1

TESTFunction · 0.85

Calls 3

ExpandNodeMethod · 0.80
LeftChildMethod · 0.45
RightChildMethod · 0.45

Tested by

no test coverage detected