Feature Extraction
How raw data becomes the language of machine learning
Data Starts Messy
Before ML can learn, it needs structured numbers — rows and columns of measurements
Every ML model starts with a table of data. Each row is one example (a house). Each column is a feature — a measurable property. The last column is the target — what we want to predict. Feature extraction is about making these columns as useful as possible.
Step 1 of 6: Data Starts Messy
Before ML can learn, it needs structured numbers — rows and columns of measurements
Every ML model starts with a table of data. Each row is one example (a house). Each column is a feature — a measurable property. The last column is the target — what we want to predict. Feature extraction is about making these columns as useful as possible.
Step 2 of 6: Features Are the Vocabulary
Each column is a feature — one measurable property the model uses to make predictions
A feature is a single measurable property — one column in your data. Numerical features like square footage have magnitude and spread. Categorical features like "pool" encode discrete groups. Understanding each feature's distribution is the first step to deciding how to transform it.
Step 3 of 6: Craft Better Signals
Transform raw columns into features that expose hidden patterns to the model
Price per Sq Ft: Normalizes price by size — a 3000 sqft house costing $600k is cheaper per foot than a 1000 sqft house at $300k. Feature engineering is the art of creating new columns from existing ones that make patterns easier for the model to see. Good features often encode domain knowledge — things you know about the problem that raw numbers don't capture.
Step 4 of 6: Put Features on Equal Footing
Normalize values so no single feature dominates by sheer magnitude
Feature scaling prevents features with large magnitudes from dominating. Min-Max squeezes values into [0, 1]. Z-Score standardization centers at zero with unit standard deviation. Most algorithms — gradient descent, KNN, SVM — need scaled features to work properly.
Step 5 of 6: Compress Without Losing Meaning
Project high-dimensional data into fewer dimensions that capture the most variance
PCA finds the axis of maximum variance — the direction along which data spreads the most. It then projects every point onto that line. Here, PC1 captures 80% of the information from 2 features in just 1 number. In real ML, PCA can compress hundreds of features into a handful of principal components.
Step 6 of 6: Keep Only What Matters
Measure each feature's predictive power and discard the noise
Feature importance scores rank how much each feature contributes to predictions. Features below the threshold add noise without signal. Dropping them gives a simpler model that generalizes better — fewer features means less overfitting, faster training, and easier interpretation.