scikit-rebate
scikit-rebate copied to clipboard
TuRF doesn't work with odd number of features
When the number of features is odd, TuRF often leaves out one feature (causing a value error at this line https://github.com/EpistasisLab/scikit-rebate/blob/master/skrebate/turf.py#L166) because segmenting of features into selected and non_selected is based on the number of features to retain: https://github.com/EpistasisLab/scikit-rebate/blob/master/skrebate/turf.py#L131
This code fixes the problem for me:
num_features_non_select = len(features_iter[iter_count]) - num_features
non_select = np.array(features_iter[iter_count].argsort()[:num_features_non_select])
Hi,
I'm an undergraduate at Penn working on this project; could you provide the data you used that caused this error? Thank you!