Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TuRF doesn't work with odd number of features #54

Open
jgoecks opened this issue Aug 21, 2018 · 1 comment
Open

TuRF doesn't work with odd number of features #54

jgoecks opened this issue Aug 21, 2018 · 1 comment

Comments

@jgoecks
Copy link

jgoecks commented Aug 21, 2018

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])
@alexmxu
Copy link
Collaborator

alexmxu commented Sep 13, 2018

Hi,

I'm an undergraduate at Penn working on this project; could you provide the data you used that caused this error? Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants