Skip to content

Commit f82f258

Browse files
committed
Merged main
Signed-off-by: Adam Li <adam2392@gmail.com>
1 parent b2544c5 commit f82f258

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

sklearn/tree/_splitter.pxd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ cdef class Splitter(BaseSplitter):
110110
cdef bint check_presplit_conditions(
111111
self,
112112
SplitRecord current_split,
113+
SIZE_t n_missing,
114+
bint missing_go_to_left,
113115
) noexcept nogil
114116
cdef bint check_postsplit_conditions(
115117
self

sklearn/tree/_splitter.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ cdef inline int node_split_best(
505505
current_split.pos = p
506506

507507
# Reject if min_samples_leaf is not guaranteed
508-
if splitter.check_presplit_conditions(current_split) == 1:
508+
if splitter.check_presplit_conditions(current_split, n_missing, missing_go_to_left) == 1:
509509
continue
510510

511511
criterion.update(current_split.pos)
@@ -834,7 +834,7 @@ cdef inline int node_split_random(
834834
current_split.pos = partitioner.partition_samples(current_split.threshold)
835835

836836
# Reject if min_samples_leaf is not guaranteed
837-
if splitter.check_presplit_conditions(current_split) == 1:
837+
if splitter.check_presplit_conditions(current_split, 0, 0) == 1:
838838
continue
839839

840840
# Evaluate split

sklearn/tree/_tree.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,7 @@ cdef class BaseTree:
764764

765765
# While node not a leaf
766766
while node.left_child != _TREE_LEAF:
767-
X_i_node_features = self._compute_feature(X_ndarray, i, node)
767+
X_i_node_feature = self._compute_feature(X_ndarray, i, node)
768768
# ... and node.right_child != _TREE_LEAF:
769769
if isnan(X_i_node_feature):
770770
if node.missing_go_to_left:

0 commit comments

Comments
 (0)