ML
beginner
Feature Scaling
AI Engineer path · lesson 21 of 124Critical preprocessing step! Learn why scaling is essential for SVM, KNN, and neural networks. Compare StandardScaler, MinMaxScaler, and RobustScaler.
Gradient Descent: Unscaled vs. Scaled Loss Surface
5:1
Feature 2 is 5× larger than Feature 1
Test which scaler resists one extreme point
Progress0/60
StandardScaler
x' = (x − μ) / σ
Best for: SVM, KNN, neural networks, PCA — general default
StandardScaler()
🌳 Tree Models Exception
Decision Trees, Random Forest, and XGBoost use feature splits — not distances or gradients — so scaling has zero effect on their predictions.
⚠ Unscaled — Elongated Contours
0
steps
3.96
dist to opt
✓ Scaled (StandardScaler) — Circular Contours
0
steps
3.96
dist to opt
Scaler Cheatsheet — click to select
Does this model care about scale?
Sort
Sort each algorithm by whether feature scaling changes its result.
Tap a piece, then tap where it goes — or drag it. Tap the tray to take one back.
Needs scaling
Drop items hereIndifferent to scale
Drop items here6 pieces left to place
Test your knowledge
21 questions
Question 1 of 21
Score: 0
Why is feature scaling important for KNN?
Interview Questions
Google
Amazon
Microsoft
LinkedIn
Workday
ADP
Uber
DoorDash
Instacart
OpenAI
NVIDIA
Intel
References & Further Reading
Love this visualization?
Sign up to track your progress, earn achievements, use the AI assistant, and access your personal learning dashboard.
100% free • No credit card required