scikit-learn/scikit-learn — pull request #1939 by jnothman (2013-05-06 12:06:23+00:00)
Title: WIP Overhaul of feature_selection

It seems to me there are commonalities between feature selection processes that are not being exploited, and places where ad-hoc code are used instead of a library.

Some of these things may be split off into a separate PR, especially on request, and all are up for discussion.

* [x] create a mixin to provide `[inverse_]transform` given `_get_support_mask()` in all feature selectors (but what to call it, given that `SelectorMixin` is taken by something else?)
* [x] provide `SelectBetween(score_func, minimum, maximum, scaling_func)` for more generic score thresholding, e.g. supporting two-sided document frequency cutoffs. This implementation also reduces work at `transform` time by pre-transforming/scaling scores to match the threshold.
* [ ] documentation and testing of above
* [ ] hopefully use `SelectBetween` for `Select{KBest,Percentile,Fdr,Fpr,Fwe,orMixin}`
* [x] `SelectorMixin`
* [ ] use `SelectBetween` to handle thresholding in `feature_extraction.text.CountVectorizer`
* [x] support dummy cases: selection by given indices; selection by feature name given a feature extractor (or union thereof)
* [ ] documentation and testing of above
* [ ] move `chi2`, `f_classify`, etc. to `sklearn.metrics.feature_scores` or similar (and add document frequency == `count_nonzero`, what else?)