scikit-learn-contrib / boruta_py

Python implementations of the Boruta all-relevant feature selection method.
BSD 3-Clause "New" or "Revised" License
1.46k stars 252 forks source link

Bug when doing feature selection #51

Closed serhiy-yevtushenko closed 5 years ago

serhiy-yevtushenko commented 5 years ago

I got following exception on the completion of feature selection by boruta:

Iteration: 34 / 100 Confirmed: 10 Tentative: 0 Rejected: 432

IndexError Traceback (most recent call last)

in () E:\Anaconda3\lib\site-packages\boruta\boruta_py.py in fit(self, X, y) 199 """ 200 --> 201 return self._fit(X, y) 202 203 def transform(self, X, weak=False): E:\Anaconda3\lib\site-packages\boruta\boruta_py.py in _fit(self, X, y) 334 335 # update rank for not_selected features --> 336 if not_selected.shape[0] > 0 and not_selected.shape[1] > 0: 337 # calculate ranks in each iteration, then median of ranks across feats 338 iter_ranks = self._nanrankdata(imp_history_rejected, axis=1) IndexError: tuple index out of range The issue seems to be caused by https://github.com/scikit-learn-contrib/boruta_py/commit/52d504bc0563d7645b28492218d6b02ad66acfb4 and could be fixed by merging following commit from https://github.com/guitarmind/boruta_py/commit/f68cfcd3aa05704dd89ee98717eec04a2c3a7708
danielhomola commented 5 years ago

merged the PR, please reinstall boruta from gitlab directly and let me know how it goes. cheers!