Skip to content

Commit b549626

Browse files
authored
Update boruta_py.py
solving issue scikit-learn-contrib#30 in _assign_hits
1 parent 3657c00 commit b549626

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 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)]
418+
cur_imp_no_nan = cur_imp[0]
419+
cur_imp_no_nan[np.isnan(cur_imp_no_nan)]=0
419420
hits = np.where(cur_imp_no_nan > imp_sha_max)[0]
420421
hit_reg[hits] += 1
421422
return hit_reg

0 commit comments

Comments
 (0)