Encoding Categorical Variables
Label encoding, one-hot encoding, ordinal encoding, pd.get_dummies() vs sklearn OrdinalEncoder.
Why Encode Categories?
Most machine learning models need NUMBERS, not text labels like "red" or "small". Encoding converts categorical variables into numeric form while preserving their meaning.
Ordinal vs Nominal
Ordinal categories have a natural order (small < medium < large). Nominal categories do not (red, green, blue). The right encoding depends on which kind you have.
All lessons in this course
- Outlier Detection and Removal
- Encoding Categorical Variables
- Feature Scaling: Normalization and Standardization
- Building Preprocessing Pipelines