Skip to content

Commit 89f5488

Browse files
mgaido91qinhanmin2014
authored andcommitted
MNT Remove useless operation in feature_importance_ (scikit-learn#13155)
1 parent be5d3ea commit 89f5488

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

sklearn/ensemble/gradient_boosting.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1634,8 +1634,7 @@ def feature_importances_(self):
16341634
normalize=False) for tree in stage) / len(stage)
16351635
total_sum += stage_sum
16361636

1637-
importances = total_sum / len(self.estimators_)
1638-
importances /= importances.sum()
1637+
importances = total_sum / total_sum.sum()
16391638
return importances
16401639

16411640
def _validate_y(self, y, sample_weight):

0 commit comments

Comments
 (0)