@@ -268,7 +268,9 @@ cdef class DepthFirstTreeBuilder(TreeBuilder):
268
268
node_id = tree._add_node(parent, is_left, is_leaf, split.feature,
269
269
split.threshold, parent_record.impurity,
270
270
n_node_samples, weighted_n_node_samples,
271
- split.missing_go_to_left)
271
+ split.missing_go_to_left,
272
+ parent_record.lower_bound,
273
+ parent_record.upper_bound)
272
274
273
275
if node_id == INTPTR_MAX:
274
276
rc = - 1
@@ -626,7 +628,8 @@ cdef class BestFirstTreeBuilder(TreeBuilder):
626
628
is_left, is_leaf,
627
629
split.feature, split.threshold, parent_record.impurity,
628
630
n_node_samples, weighted_n_node_samples,
629
- split.missing_go_to_left)
631
+ split.missing_go_to_left,
632
+ parent_record.lower_bound, parent_record.upper_bound)
630
633
if node_id == INTPTR_MAX:
631
634
return - 1
632
635
@@ -774,6 +777,14 @@ cdef class Tree:
774
777
def missing_go_to_left (self ):
775
778
return self ._get_node_ndarray()[' missing_go_to_left' ][:self .node_count]
776
779
780
+ @property
781
+ def lower_bound (self ):
782
+ return self ._get_node_ndarray()[' lower_bound' ][:self .node_count]
783
+
784
+ @property
785
+ def upper_bound (self ):
786
+ return self ._get_node_ndarray()[' upper_bound' ][:self .node_count]
787
+
777
788
@property
778
789
def value (self ):
779
790
return self ._get_value_ndarray()[:self .node_count]
@@ -910,7 +921,9 @@ cdef class Tree:
910
921
intp_t feature, float64_t threshold, float64_t impurity,
911
922
intp_t n_node_samples,
912
923
float64_t weighted_n_node_samples,
913
- uint8_t missing_go_to_left) except - 1 nogil:
924
+ uint8_t missing_go_to_left,
925
+ float64_t lower_bound,
926
+ float64_t upper_bound) except - 1 nogil:
914
927
""" Add a node to the tree.
915
928
916
929
The new node registers itself as the child of its parent.
@@ -927,6 +940,8 @@ cdef class Tree:
927
940
node.impurity = impurity
928
941
node.n_node_samples = n_node_samples
929
942
node.weighted_n_node_samples = weighted_n_node_samples
943
+ node.lower_bound = lower_bound
944
+ node.upper_bound = upper_bound
930
945
931
946
if parent != _TREE_UNDEFINED:
932
947
if is_left:
@@ -1934,7 +1949,8 @@ cdef _build_pruned_tree(
1934
1949
new_node_id = tree._add_node(
1935
1950
parent, is_left, is_leaf, node.feature, node.threshold,
1936
1951
node.impurity, node.n_node_samples,
1937
- node.weighted_n_node_samples, node.missing_go_to_left)
1952
+ node.weighted_n_node_samples, node.missing_go_to_left,
1953
+ node.lower_bound, node.upper_bound)
1938
1954
1939
1955
if new_node_id == INTPTR_MAX:
1940
1956
rc = - 1
0 commit comments