Feature selection

What is Feature Selection

= Select a subset of all features for model training, usually in data preprocessing.

Feature Selection methods

There are some of the techniques used for feature selection in data analysis.

Method Type Idea Pros Cons
Filter methods select features using statistics before modeling simple and fast; good preprocessing step can select redundant features; may ignore feature interactions
Wrapper methods search feature subsets using model performance can find feature combinations that work well together slow; can overfit
Embedded / Intrinsic methods feature selection happens during model training efficient; directly connected to the model objective model-dependent; selected features depend on chosen model

Filter methods

= select features before model training using statistical scores or simple rules
examples:

Wrapper methods

= iterative process that repeatedly adds or removes subsets of features and checks model performance
examples:

Embedded / Intrinsic methods

= model already performs feature selection during training, so no external selection tool is needed
examples:

Feature Selection Stability

= checks whether selected features remain important across different samples of the data.

Why it matters

Common approaches

Sparse/Non-sparse Model (Sparse Model) Model type What to track Example stability measure
Sparse Sparse model selected / not selected features selection frequency
Non-sparse Linear non-sparse model coefficient size and sign coefficient variance, sign consistency
Non-sparse Tree-based model feature importance scores rank correlation, top-k overlap
Non-sparse Black-box model permutation importance or SHAP values rank correlation, importance variance

Typical workflow for sparse models

  1. Subsample the training data many times
  2. Fit a sparse model each time
  3. Record which features are selected each time
  4. Calculate selection frequency for each feature
  5. Rank features by how often they are selected

Typical workflow for non-sparse models

  1. Resample the training data many times
  2. Fit the model each time
  3. Calculate feature importance each time, e.g. coefficients, permutation importance, tree-based importance, or SHAP values
  4. Compare feature rankings or top-k important features across resamples
  5. Check whether the same features remain consistently important
Important

A model can have stable performance but unstable selected features, especially when features are highly correlated.