Skip to content

Commit 3657c00

Browse files
authored
Merge pull request scikit-learn-contrib#35 from tagomatech/master
solved the NA issue in _assign_hits()
2 parents b5ab61f + e1ddfb9 commit 3657c00

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

boruta/boruta_py.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,8 +414,9 @@ def _add_shadows_get_imps(self, X, y, dec_reg):
414414
return imp_real, imp_sha
415415

416416
def _assign_hits(self, hit_reg, cur_imp, imp_sha_max):
417-
# register hits for feautres that did better than the best of shadows
418-
hits = np.where(cur_imp[0] > imp_sha_max)[0]
417+
# register hits for features that did better than the best of shadows
418+
cur_imp_no_nan = [val for val in cur_imp[0] if not np.isnan(val)]
419+
hits = np.where(cur_imp_no_nan > imp_sha_max)[0]
419420
hit_reg[hits] += 1
420421
return hit_reg
421422

0 commit comments

Comments
 (0)