A topic in the Open Knowledge Graph — a free, open map of 15,290 topics and the order to learn them in.

Feature Engineering and Selection

Graduate Depth 89 in the knowledge graph ☐ I know this ☆ Set as goal
3topics build on this
500prerequisites beneath it
See this on the map →
Supervised Learning FundamentalsDimensionality Reduction Techniques→→Content-Based FilteringCurse of Dimensionality+1 more
features preprocessing dimensionality-reduction feature-importance

Core Idea

Feature engineering creates new features from raw data to improve model performance (e.g., polynomial features, domain-specific transformations), while feature selection removes irrelevant or redundant features. Methods range from domain knowledge and statistical tests (univariate selection) to wrapper methods (forward/backward selection) and embedded methods (regularization penalties), where the choice impacts both accuracy and generalization.

How It's Best Learned

Compare models before and after feature engineering on a real dataset, then use embedded methods (e.g., Lasso) to identify important features.

Explainer

From supervised learning, you know that a model learns a mapping from input features to output labels. But the quality of that mapping depends enormously on what you feed in. Raw data rarely comes in a form that makes the underlying patterns obvious to a learning algorithm. Feature engineering is the art of transforming raw inputs into representations that expose those patterns, and feature selection is the discipline of keeping only the features that help while discarding those that add noise or redundancy. Together, they often matter more than the choice of algorithm — a simple model on well-engineered features routinely outperforms a complex model on raw data.

Feature engineering creates new variables from existing ones using domain knowledge and mathematical transformations. If you are predicting house prices and have a "lot width" and "lot depth" column, creating a "lot area" feature (width × depth) gives the model a directly useful signal it would otherwise have to learn implicitly. Polynomial features capture nonlinear relationships — squaring an age variable lets a linear model learn that both very young and very old patients have higher risk. Interaction features (multiplying two variables together) capture cases where the effect of one variable depends on the value of another. Binning converts continuous variables into categories (age → age group), which can help when the relationship is step-like rather than smooth. The guiding question is always: "What transformation would make the pattern I expect to find linearly separable or more obvious to the model?"

Feature selection addresses the opposite problem: having too many features. Irrelevant features add noise that the model may overfit to. Redundant features (two highly correlated columns) waste capacity without adding information. There are three main families of selection methods. Filter methods score each feature independently using statistical tests (correlation, mutual information, chi-squared) and keep the top k — fast but blind to feature interactions. Wrapper methods evaluate subsets of features by training and testing the model (forward selection adds features one at a time; backward elimination removes them), capturing interactions but being computationally expensive. Embedded methods perform selection as part of training — Lasso (L1 regularization) drives unimportant feature weights to exactly zero, simultaneously fitting the model and selecting features.

A practical workflow starts with domain-driven feature engineering, then uses embedded or filter methods to prune. If you know from dimensionality reduction that your data lives on a low-dimensional manifold, feature selection can be viewed as finding the coordinate system that aligns with that manifold. One critical warning: always perform feature selection using only training data. If you compute feature importance on the full dataset (including test data) and then select features, you leak information from the test set into training, producing overly optimistic performance estimates that will not hold up on truly unseen data. This train-only rule applies equally to all selection methods and is one of the most common sources of inflated results in applied machine learning.

Practice Questions 5 questions

Prerequisite Chain

Understanding Zero → The Number Zero → Counting to Five → Counting to 10 → Counting to 20 → Counting a Set of Objects Up to 20 → Cardinality: The Last Number Counted → Matching Numerals to Quantities → Subitizing Small Quantities → Addition Within 10 → Number Bonds to 10 → Addition Within 20 → Doubles and Near Doubles → Doubles Facts Within 10 → Near Doubles Facts Within 20 → Mental Math Strategies for Addition → Mental Math: Adding and Subtracting Tens → Addition Within 100 → Repeated Addition as Multiplication → Multiplication as Equal Groups → Multiplication: Arrays → Basic Multiplication Facts (0s, 1s, 2s, 5s, 10s) → Multiplication Facts Within 100 → Division as Equal Sharing → Division as Grouping (Measurement Division) → Division: Grouping (Repeated Subtraction) Model → Division: Fair Sharing Model → Division as Equal Sharing → Division as Grouping → Basic Division Facts → Division Facts Within 100 → Multiplication and Division Fact Families → Relationship Between Multiplication and Division → Division Facts as Inverse of Multiplication → Remainders and Quotients in Division → Division Word Problems → Multi-Step Word Problems → Solving Multi-Step Word Problems → Multiplication Word Problems → Division Word Problems → Introduction to Long Division → Factors and Multiples → Prime and Composite Numbers → Equivalent Fractions → Relating Fractions and Decimals → Decimal Place Value → Integers and the Number Line → Comparing and Ordering Integers → Absolute Value → Adding Integers → Subtracting Integers → Multiplying Integers → Dividing Integers → Unit Rates → Proportions → Percent Concept → Converting Between Fractions, Decimals, and Percents → Operations with Rational Numbers → Two-Step Equations → Solving Multi-Step Equations → Equations with Variables on Both Sides → Angle Pairs: Complementary, Supplementary, and Vertical → Parallel Lines and Transversals → Corresponding Angles → Alternate Interior Angles → Triangle Angle Sum Theorem → Exterior Angle Theorem → Triangle Inequality Theorem → Similar Triangles: AA Similarity → Similar Triangles: SSS and SAS Similarity → Proportions in Similar Triangles → Right Triangle Trigonometry Introduction → Sine, Cosine, and Tangent Ratios → Trigonometric Ratios Review → Vectors in Two Dimensions → Vector Operations: Addition, Subtraction, and Scalar Multiplication → Dot Product (Inner Product in R^n) → Matrix Multiplication → Determinants of 2×2 and 3×3 Matrices → Invertible Matrices and Matrix Inverses → Systems of Linear Equations and Matrix Form → Gaussian Elimination and Row Reduction → Row Echelon Form and Back Substitution → The Standard Matrix of a Linear Transformation → Composition of Linear Transformations → Change of Basis and Coordinate Systems → Diagonalization → Principal Component Analysis → Dimensionality Reduction Techniques → Feature Engineering and Selection

Longest path: 90 steps · 500 total prerequisite topics

Prerequisites (2)

Leads To (3)