Skip to content

Commit 47f6cd4

Browse files
authored
Merge pull request scikit-learn-contrib#38 from Saravji/Saravji-patch-1
Update boruta_py.py
2 parents 52d504b + 06febb1 commit 47f6cd4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

boruta/boruta_py.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,8 @@ def _add_shadows_get_imps(self, X, y, dec_reg):
419419

420420
def _assign_hits(self, hit_reg, cur_imp, imp_sha_max):
421421
# register hits for features that did better than the best of shadows
422-
cur_imp_no_nan = [val for val in cur_imp[0] if not np.isnan(val)]
422+
cur_imp_no_nan = cur_imp[0]
423+
cur_imp_no_nan[np.isnan(cur_imp_no_nan)] = 0
423424
hits = np.where(cur_imp_no_nan > imp_sha_max)[0]
424425
hit_reg[hits] += 1
425426
return hit_reg

0 commit comments

Comments
 (0)