Day 12 Part 2 Kaggle's 30 Days of ML
Course Step 3 of Intermediate Machine Learning.
Categorical Variable:
- Nominal: no order (like gender)
- Ordinal: has order (like low-medium-high)
How to deal with categorical data:
- Give each var a lable number.
- Use binarization: give each var a number and binarize it.
- Delete the var
- One-Hot Encoding:
create a new col to show the presence.
Code for method 2:
code for method 1:
code for method 3: