liveBook · Manning

Feature selection

As explained in Machine Learning System Design

Feature selection is the process of choosing a subset of available input features for a machine learning model.

Suppose a model can use hundreds of inputs, but many repeat the same information or add little useful signal. Feature selection chooses a smaller, informative subset. It complements feature generation: create plausible inputs, test their value, then prune what does not earn its place. The goal is not simply fewer features; it is a model that meets its quality, speed, and interpretability needs. section 11.3 section 11.3.1

Why prune? Removing irrelevant or redundant inputs can reduce overfitting, training time, and serving cost. It can also make decisions easier to explain and eliminate unnecessary data sources from training and serving pipelines. But judge the result against the system’s constraints: a small accuracy gain may not justify slower predictions in a real-time application. section 11.3.2

Choose a method that fits the features and the cost of evaluation:

  • Filter methods rank features without fitting the primary model. They scale well and can provide a quick first pass: retain the top-ranked inputs, or pass them to a more intensive method. Rankings can use individual properties or compare features for overlapping information. section 11.3.3
  • Wrapper methods evaluate feature subsets using a model and a chosen metric. Sequential forward selection adds features from an empty set; sequential backward elimination removes them. These methods require an appropriate validation scheme nested within outer validation. section 11.3.3
  • Embedded methods are a third family. Lasso regression illustrates selection through coefficients that reach zero as L1 regularization increases. section 11.3.3

Selecting photo-ranking inputs

A photo-ranking system might derive features from tags, EXIF coordinates, dates, and camera models. Trimming tags to the informative ones is one selection decision. Adding even a feature that leaves quality metrics unchanged can increase training and inference time when it lengthens a transformer-based model’s input. With a small set of these features, sequential greedy selection is suggested as a precise, though slow, option rather than applying filtering methods unchanged. section 11.5.2

Treat selection as part of learning, not as a harmless preliminary check. Repeatedly choosing features against the same validation split can bias the result; reassess validation when data sources or features change. In a training pipeline, select before training and freeze the chosen features for subsequent steps. Feature-importance analysis can then help explain which inputs contribute to predictions and where further feature work may be worthwhile. section 7.1 section 10.1.1 section 11.6

How Machine Learning System Design covers it

How deep it goes
Explains filter rankings, wrapper subset search, and nested validation; identifies embedded methods and illustrates Lasso without deriving algorithms.
Examples
Uses photo-ranking metadata and tags to weigh greedy selection against transformer input costs.
What it assumes
Assumes familiarity with model inputs and evaluation while defining why and how to prune generated features.
What you can do after
Apply it via filter or wrapper methods to choose a subset, validate the choice, and freeze features before training.
How it connects
Connects feature generation, feature importance, validation schemas, preprocessing, and training and inference pipelines.

Also explained in

Compare how 8 books explain feature selection →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Machine Learning System Design. The section links point to the parts of the book it draws on.