I am applying the feature selection method, RFE (recursive feature elimination), from scikit-learn to a dataset. I do not have any pre-determined number of features for RFE and would rather get the number from data itself.

So far, I applied range of number of features, 1 to 10, for training data. For evaluation, I use the F1 from prediction outcome using the features from RFE. For serialization, I plan to use the number of features that provided the best F1.

What other methods may be used to determine the number of features for RFE? Thanks!


I encourage you to look at this method https://scikit-learn.org/stable/modules/generated/sklearn.feature_selection.RFECV.html#sklearn.feature_selection.RFECV, it allows you to recursively test all of your features based on the scoring method of your choice including F1

| improve this answer | |
  • 1
    $\begingroup$ You should add more info on the suggested method (links can be broken in the future) $\endgroup$ – Mark.F Dec 24 '18 at 21:22

Generally, there are 3 Feature Selection methods:

  • Filter Methods
  • Wrapper Methods
  • Embedded Methods

I believe Feature Selection is totally overrated. But what do I know?

There's an amazing Feature Selection course on Udemy by Dr. Soledad Galli:


| improve this answer | |
  • $\begingroup$ Why do you feel feature selection is overrated? An explanation might help $\endgroup$ – HFulcher Feb 22 '19 at 20:29
  • $\begingroup$ (a) if you have 10 rows for each column, you should be fine (b) RFE sounds intellectually sound, but I've not seen a difference in accuracy of more than 0.10% $\endgroup$ – FrancoSwiss Feb 22 '19 at 20:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.