Skip to content

Commit

Permalink
revert this file to original version
Browse files Browse the repository at this point in the history
  • Loading branch information
morgsmss7 authored Dec 14, 2019
1 parent a50062b commit d717241
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions sklearn/tree/_tree.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ cdef class DepthFirstTreeBuilder(TreeBuilder):

# Recursive partition (without actual recursion)
splitter.init(X, y, sample_weight_ptr, X_idx_sorted)

cdef SIZE_t start
cdef SIZE_t end
cdef SIZE_t depth
Expand Down Expand Up @@ -226,8 +226,9 @@ cdef class DepthFirstTreeBuilder(TreeBuilder):
weighted_n_node_samples < 2 * min_weight_leaf)

if first:
impurity = splitter.node_impurity(&split)
impurity = splitter.node_impurity()
first = 0

is_leaf = (is_leaf or
(impurity <= min_impurity_split))

Expand Down Expand Up @@ -333,6 +334,7 @@ cdef class BestFirstTreeBuilder(TreeBuilder):

# Recursive partition (without actual recursion)
splitter.init(X, y, sample_weight_ptr, X_idx_sorted)

cdef PriorityHeap frontier = PriorityHeap(INITIAL_STACK_SIZE)
cdef PriorityHeapRecord record
cdef PriorityHeapRecord split_node_left
Expand Down Expand Up @@ -445,9 +447,8 @@ cdef class BestFirstTreeBuilder(TreeBuilder):
splitter.node_reset(start, end, &weighted_n_node_samples)

if is_first:
impurity = splitter.node_impurity(&split)
else:
splitter.node_impurity(&split)
impurity = splitter.node_impurity()

n_node_samples = end - start
is_leaf = (depth >= self.max_depth or
n_node_samples < self.min_samples_split or
Expand Down

0 comments on commit d717241

Please sign in to comment.