Encoding and Scaling Features
Encoding and Scaling Features
ML models need numerical inputs. Learn to encode categories and scale numbers.
Encoding Categorical Features
Loading Python Playground...
Feature Scaling
Loading Python Playground...
Key Takeaways
- Label encoding for ordinal categories (small/medium/large)
- One-hot encoding for nominal categories (red/green/blue)
- StandardScaler: mean=0, std=1 (most common)
- MinMaxScaler: scales to 0-1 range
- Many algorithms require scaling (SVM, KNN, Neural Nets)
- Tree-based models don't need scaling

