Lines Matching defs:split

35 // SplitCandidate holds the split candidate node along with the stats.
37 // Id of handler that generated the split candidate.
52 // Helper method to update the best split per partition given
56 int32 partition_id, SplitCandidate* split,
59 if (TF_PREDICT_FALSE(split->split_info.split_node().node_case() ==
69 split->gain < 0) {
73 // If the current node is pure, one of the leafs will be empty, so the split
74 // is meaningless and we should not split.
75 if (!(IsLeafWellFormed(split->split_info.right_child()) &&
76 IsLeafWellFormed(split->split_info.left_child()))) {
77 VLOG(1) << "Split does not actually split anything";
81 // Take the split if we don't have a candidate yet.
84 best_splits->insert(std::make_pair(partition_id, std::move(*split)));
88 // Determine if best split so far needs to be replaced.
90 if (TF_PREDICT_FALSE(split->gain == best_split.gain)) {
93 << "(current split: " << split->split_info.split_node().node_case()
94 << ", best split: "
96 if (split->split_info.split_node().node_case() <
98 best_split = std::move(*split);
99 } else if (split->split_info.split_node().node_case() ==
103 << "(current split: " << split->handler_id
104 << ", best split: " << best_split.handler_id << ")";
105 if (split->handler_id > best_split.handler_id) {
106 best_split = std::move(*split);
109 } else if (split->gain > best_split.gain) {
110 best_split = std::move(*split);
146 // 1- The split gain is negative.
352 // Read partition Ids, gains and split candidates.
421 // Helper method which effectively does a reduce over all split candidates
422 // and finds the best split for each partition.
429 // Find best split per partition going through every feature candidate.
451 // Get current split candidate.
455 SplitCandidate split;
456 split.handler_id = handler_id;
457 split.gain = gain;
458 OP_REQUIRES(context, split.split_info.ParseFromString(serialized_split),
459 errors::InvalidArgument("Unable to parse split info."));
461 // Update best split for partition based on the current candidate.
462 UpdateBestSplit(learner_config_, partition_id, &split, best_splits);
619 // Helper method to split a tree node and append its respective
620 // leaf children given the split candidate.
622 const int32 node_id, SplitCandidate* split,
627 << "Invalid node " << node_id << " to split.";
628 // Ensure new split node is valid.
629 CHECK(split->split_info.split_node().node_case() != TreeNode::NODE_NOT_SET);
631 << "Unexpected node type to split "
639 split->split_info.mutable_left_child());
645 split->split_info.mutable_right_child());
649 {left_id, right_id}, split->split_info.mutable_split_node());
651 // Add split gain and, if needed, original leaf to node metadata.
653 split->split_info.mutable_split_node()->mutable_node_metadata();
654 node_metadata->set_gain(split->gain);
663 *split->split_info.mutable_split_node();
665 ensemble_resource->MaybeAddUsedHandler(split->handler_id);