From ae2604ba53d092eaaec64eba0136a76460586cb0 Mon Sep 17 00:00:00 2001 From: Adam Li Date: Thu, 11 Jul 2024 08:44:43 -0400 Subject: [PATCH] Make sure its defined Signed-off-by: Adam Li --- sklearn/tree/_splitter.pyx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sklearn/tree/_splitter.pyx b/sklearn/tree/_splitter.pyx index e85f6ef5b2257..82835910fb800 100644 --- a/sklearn/tree/_splitter.pyx +++ b/sklearn/tree/_splitter.pyx @@ -959,6 +959,13 @@ cdef inline int node_split_random( current_split.threshold ) + if missing_go_to_left: + n_left = current_split.pos - start + n_missing + n_right = end_non_missing - current_split.pos + else: + n_left = current_split.pos - start + n_right = end_non_missing - current_split.pos + n_missing + # Reject if min_samples_leaf is not guaranteed if splitter.check_presplit_conditions(¤t_split, n_missing, missing_go_to_left) == 1: continue