From b54962613e66dc057a2c67000573d72db04034d4 Mon Sep 17 00:00:00 2001 From: Dirk Biesinger Date: Thu, 8 Feb 2018 09:27:44 -0800 Subject: [PATCH 1/2] Update boruta_py.py solving issue #30 in _assign_hits --- boruta/boruta_py.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/boruta/boruta_py.py b/boruta/boruta_py.py index 6122825..e8c592f 100644 --- a/boruta/boruta_py.py +++ b/boruta/boruta_py.py @@ -415,7 +415,8 @@ def _add_shadows_get_imps(self, X, y, dec_reg): def _assign_hits(self, hit_reg, cur_imp, imp_sha_max): # register hits for features that did better than the best of shadows - cur_imp_no_nan = [val for val in cur_imp[0] if not np.isnan(val)] + cur_imp_no_nan = cur_imp[0] + cur_imp_no_nan[np.isnan(cur_imp_no_nan)]=0 hits = np.where(cur_imp_no_nan > imp_sha_max)[0] hit_reg[hits] += 1 return hit_reg From 06febb168470f60a160798c03beaa76ba2fb8ccf Mon Sep 17 00:00:00 2001 From: Daniel Homola Date: Thu, 31 Jan 2019 13:42:56 +0000 Subject: [PATCH 2/2] Update boruta_py.py --- boruta/boruta_py.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boruta/boruta_py.py b/boruta/boruta_py.py index e8c592f..7afd07c 100644 --- a/boruta/boruta_py.py +++ b/boruta/boruta_py.py @@ -416,7 +416,7 @@ def _add_shadows_get_imps(self, X, y, dec_reg): def _assign_hits(self, hit_reg, cur_imp, imp_sha_max): # register hits for features that did better than the best of shadows cur_imp_no_nan = cur_imp[0] - cur_imp_no_nan[np.isnan(cur_imp_no_nan)]=0 + cur_imp_no_nan[np.isnan(cur_imp_no_nan)] = 0 hits = np.where(cur_imp_no_nan > imp_sha_max)[0] hit_reg[hits] += 1 return hit_reg