Description
Currently, makeFilterWrapper allows three different methods of thresholding to select the top scoring features:
- fw.perc - a percentage of the total number of features,
- fw.abs - a fixed number of features, and
- fw.threshold - a threshold on the value produced by the filter.
I would like to propose a fourth method to allow more flexibility. I suggest that makeFilterWrapper also accepts a custom thresholding function, which would allow users to do their own thresholding. For example, when using random forest variable importance, you might want to look for the biggest gap in importance values and only select the features with importance values above that gap.
In this proposal makeFilterWrapper would be extended to accept two new arguments:
- fw.func - the function itself, default value NULL
- fw.func.args - a named list of arguments to the function, default value NULL
The function would be passed a named list of arguments, the first of which would always be named "values" and would be a vector of values returned from the filter. Other arguments could be specified in fw.func.args.
The function would return the number of top-scoring features to select and would be mutually exclusive with fw.abs, fw.perc and fw.threshold.
I have coded this and can do a PR if this idea is accepted.