EpistasisLab / EpistasisLab/scikit-rebate
TuRF doesn't work with odd number of features
- Dominant language
- Jupyter Notebook
- Stars
- 420
- Forks
- 72
- Avg merge
- 3m
- Merged PRs (30d)
- 3
Description
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])
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.