liveBook · Manning

Feature selection

As explained in Grokking Machine Learning

Feature selection is a technique that chooses relevant input features and removes unnecessary or harmful ones before model training.

Imagine preparing a dataset before teaching a model. Feature selection means choosing useful input columns and removing unnecessary or potentially harmful ones before training. section 13.3 section 13.7

Selection belongs to feature engineering and preprocessing. It follows decisions about numerical and categorical data, including one-hot encoding or binning, and leaves a cleaner set of model inputs. section 13.3

A practical selection pass can look like this:

  • Inspect the columns and decide which represent useful information for the prediction task. section 13.3
  • Do not treat a model's current feature usage as a complete selection method: greedy decision trees can miss combinations of individually weak features. section 9.5
  • For a more deliberate method, consider L1 regularization when selecting features. section 9.5

Titanic preprocessing

After cleaning the passenger dataset, categorical columns such as Sex and Embarked are converted into numerical columns. The original columns can then be removed, while Name, Ticket, and PassengerId are dropped as unused features. section 13.3

How Grokking Machine Learning covers it

How deep it goes
Defines manual removal, demonstrates column dropping, and notes L1 regularization while stopping short of its algorithmic mechanics.
Examples
Uses Titanic columns and a student-admissions decision tree to illustrate dropping fields and the limits of greedy selection.
What it assumes
Assumes cleaned data and basic numerical-versus-categorical distinctions, while explaining why models require numerical inputs.
What you can do after
Apply it via pandas by removing selected columns before fitting a model, while avoiding conclusions from tree usage alone.
How it connects
Connects feature engineering with one-hot encoding, binning, decision trees, and L1 regularization.

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 Grokking Machine Learning. The section links point to the parts of the book it draws on.