Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9f0828a

Browse files
committed
ENH: renamed things too fast...
1 parent 45c0f04 commit 9f0828a

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

sklearn/tree/_tree.c

Lines changed: 16 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sklearn/tree/_tree.pyx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2530,14 +2530,14 @@ cdef class Tree:
25302530
node += 1
25312531

25322532
importances = importances / nodes[0].weighted_n_node_samples
2533-
cdef double weighted_n_samples
2533+
cdef double normalizer
25342534

25352535
if normalize:
2536-
weighted_n_samples = np.sum(importances)
2536+
normalizer = np.sum(importances)
25372537

2538-
if weighted_n_samples > 0.0:
2538+
if normalizer > 0.0:
25392539
# Avoid dividing by zero (e.g., when root is pure)
2540-
importances /= weighted_n_samples
2540+
importances /= normalizer
25412541

25422542
return importances
25432543

0 commit comments

Comments
 (0)