Skip to content

Commit f68cfcd

Browse files
author
Mark Peng
committed
Fixed Tuple Index Out of range error and unit test.
1 parent 0fad976 commit f68cfcd

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

boruta/boruta_py.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ def _fit(self, X, y):
333333
imp_history_rejected = imp_history[1:, not_selected] * -1
334334

335335
# update rank for not_selected features
336-
if not_selected.shape[0] > 0 and not_selected.shape[1] > 0:
336+
if not_selected.shape[0] > 0:
337337
# calculate ranks in each iteration, then median of ranks across feats
338338
iter_ranks = self._nanrankdata(imp_history_rejected, axis=1)
339339
rank_medians = np.nanmedian(iter_ranks, axis=0)

boruta/test/unit_tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def test_if_boruta_extracts_relevant_features(self):
4040
bt.fit(X, y)
4141

4242
# make sure that only all the relevant features are returned
43-
self.assertItemsEqual(range(5), list(np.where(bt.support_)[0]))
43+
self.assertListEqual(list(range(5)), list(np.where(bt.support_)[0]))
4444

4545

4646
if __name__ == '__main__':

0 commit comments

Comments
 (0)