rasbt / rasbt/mlxtend

Replace `k_features` in `SequentialFeatureSelector` by `feature_range` and `recipe`

Open
#261 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

API Change
Dominant language
Python
Stars
5.2k
Forks
916
Avg merge
17h 31m
Merged PRs (30d)
4

Description

For ease of use and versatility, the k_features parameter should be changed to

  • feature_range: (min_val, max_val) or "all"
  • recipe: "best" or "parsimonious"

Regarding feature_range, if "all" is selected, feature subsets of all sizes will be considered as candidates for the best feature subset selected based on what's specified under recipe.

Regarding recipe, if "best" is provided, the feature selector will return the
feature subset with the best cross-validation performance.
If "parsimonious" is provided as an argument, the smallest
feature subset that is within one standard error of the
cross-validation performance will be selected.

I.e., if feature_range=(3, 5) and recipe='best', the best feature subset with the best performance will be selected, and this feature subset can either have 3, 4, or 5 features.

Note that it would be best to deprecate k_features and default it to None. However if k_features is not None, it should have priority over the new parameters to avoid breaking existing code bases.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the SequentialFeatureSelector entry point and trace how k_features currently controls candidate subsets and selection. Review the existing behavior before defining the feature_range and recipe interactions, including k_features precedence and deprecation. Done means the new options support the requested selection rules without breaking existing k_features usage.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.