question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

sklearn.feature_selection.SequentialFeatureSelector Select features as long as score gets better.

See original GitHub issue

Dear Developers,

Currently one can give sklearn.feature_selection.SequentialFeatureSelector parameter ‘n_features_to_select’ to get desired number of features.

It would be desired, that instead of giving a fixed number of ‘n_features_to_select’ one could use it as an upper limit and select features only up to point where the score improves (so the number of selected features could be smaller than ‘n_features_to_select’).

Terveisin, Markus

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:10 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
NicolasHugcommented, Jun 1, 2021

Yes this sounds good.

An alternative that I slightly prefer would be to directly introduce tol=0 and instead do the deprecation on n_features_to_select:

  • set n_features_to_select to ‘warn’ indicating that None is deprecated in favor of ‘auto’
  • Switch the default to ‘auto’ in 2 versions and remove None.

The reason the default is currently None is for consistency with RFE, but ‘auto’ is a more accurate name. Since we have to deprecate something anyway, we might as well introduce a better name in the process.

I’m fine with either strategy anyway, so feel free to implement the one you like best.

0reactions
ogriselcommented, Jun 1, 2021

@NicolasHug do you agree with the plan above? If so we can implement it as part of #20145.

Read more comments on GitHub >

github_iconTop Results From Across the Web

sklearn.feature_selection.SequentialFeatureSelector
This Sequential Feature Selector adds (forward selection) or removes (backward selection) features to form a feature subset in a greedy fashion. At each...
Read more >
Why Feature Selection with sklearn.feature_selection ...
Your question deals with the potential for selection bias, in which the features selected can bias the results because only features which help ......
Read more >
The popular forward and backward feature selection ...
Example 9 -- Selecting the "best" feature combination in a k-range ; import SequentialFeatureSelector as ; from sklearn.neighbors import ; from mlxtend.data import ......
Read more >
5 Feature Selection Method from Scikit-Learn you should know
Feature selection is a method to reduce the variables by using ... Improve your performance by selecting only the most important features.
Read more >
Take the best performance during a Sequential Feature ...
I would like to perform a Sequential Feature Selector (SFS) with ... get automatically the feature selection corresponding to the best ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found