File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -153,6 +153,10 @@ cdef class HonestPruner(Splitter):
153153
154154 n_missing += 1
155155 current_end -= 1
156+
157+ # Leverage sklearn's forked API to compute the feature value at this split node
158+ # and then compare that to the corresponding threshold
159+ # Note: this enables the function to work w/ both axis-aligned and oblique splits.
156160 elif p > pos and (self .tree._compute_feature(X_ndarray, sample_idx, & self .tree.nodes[node_idx])<= threshold):
157161 self .samples[p], self .samples[pos] = \
158162 self .samples[pos], self .samples[p]
@@ -368,9 +372,8 @@ cdef _honest_prune(
368372 split_is_degenerate = (
369373 pruner.n_left_samples() == 0 or pruner.n_right_samples() == 0
370374 )
371- # is_leaf_in_origtree = child_l[node_idx] == _TREE_LEAF
372- # consider whether left or right children node is a leaf node.
373- is_leaf_in_origtree = (child_l[node_idx] == _TREE_LEAF and child_r[node_idx] == _TREE_LEAF)
375+
376+ is_leaf_in_origtree = child_l[node_idx] == _TREE_LEAF
374377
375378 if invalid_split or split_is_degenerate or is_leaf_in_origtree:
376379 # invalid_split or is_leaf_in_origtree:
You can’t perform that action at this time.
0 commit comments