Skip to content

Commit bda2823

Browse files
authored
solved the NA issue in _assign_hits()
1 parent 64a41d2 commit bda2823

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
@@ -415,7 +415,8 @@ def _add_shadows_get_imps(self, X, y, dec_reg):
415415

416416
def _assign_hits(self, hit_reg, cur_imp, imp_sha_max):
417417
# register hits for feautres that did better than the best of shadows
418-
hits = np.where(cur_imp[0] > imp_sha_max)[0]
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)