How would you approach feature selection when you have far more features than training samples?

Quick Overview

Asks how to choose features when a dataset has far more features than training samples, as in genomics or text data. Tests knowledge of filter, embedded and wrapper methods, penalized regression with correlated features, and how to validate selection without inflating the score.

How would you approach feature selection when you have far more features than training samples?

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: hard

Interview Round: Other

You have a dataset with far more features than training samples ($p \gg n$), for example a few hundred patients with tens of thousands of gene expression measurements each. How would you approach feature selection when you have far more features than training samples? ```hint Where selection happens Ask what happens to your cross-validated score if you choose features using all the labels before you split the data. ``` ```hint Correlated features Think about what an L1 penalty does when several features carry the same signal, and how many nonzero coefficients it can keep with only n samples. ``` ### What a Strong Answer Covers - Why $p \gg n$ makes overfitting and chance associations likely, and what that means for selection - A layered approach: cheap label-free pruning, univariate filters with multiple-testing control, and embedded penalized models - How Lasso and Elastic Net differ on correlated features and on the number of features they can keep - Keeping every label-dependent step inside cross-validation or nested cross-validation - Checking that the chosen features are stable across resamples, and feature extraction such as PCA or PLS as an alternative ### Follow-up Questions - A colleague selected features on the full data, then ran 5-fold CV and reports an AUC of 0.95. How would you check whether that number is real? - How does stability selection work, and how would you pick its selection threshold? - When would you prefer PLS or PCA components over a subset of the original features? - The domain team wants an interpretable feature list, but different folds select different features. What do you report?

Overview: Asks how to choose features when a dataset has far more features than training samples, as in genomics or text data. Tests knowledge of filter, embedded and wrapper methods, penalized regression with correlated features, and how to validate selection without inflating the score.

Nov 24, 2026
hardMachine Learning EngineerOtherMachine Learning
0
0

You have a dataset with far more features than training samples (p≫np \gg n), for example a few hundred patients with tens of thousands of gene expression measurements each. How would you approach feature selection when you have far more features than training samples?

What a Strong Answer Covers Guidance

  • Why p≫np \gg n makes overfitting and chance associations likely, and what that means for selection
  • A layered approach: cheap label-free pruning, univariate filters with multiple-testing control, and embedded penalized models
  • How Lasso and Elastic Net differ on correlated features and on the number of features they can keep
  • Keeping every label-dependent step inside cross-validation or nested cross-validation
  • Checking that the chosen features are stable across resamples, and feature extraction such as PCA or PLS as an alternative

Follow-up Questions Guidance

  • A colleague selected features on the full data, then ran 5-fold CV and reports an AUC of 0.95. How would you check whether that number is real?
  • How does stability selection work, and how would you pick its selection threshold?
  • When would you prefer PLS or PCA components over a subset of the original features?
  • The domain team wants an interpretable feature list, but different folds select different features. What do you report?