# To One-Hot-Encode or not to One-Hot-Encode?

I have been struggling to find proof for that but I couldnt

Every time I prepare dataset I face the same issue

when a column is a classification such as CountryCode or TaskType in this dataset

TaskType  CountryCode  Target
1         61           Red
1         962          Yellow
2         1            Yellow
6         61           Yellow
4         81           Red
2         1            Blue
1         61           Red
2         962          Green
4         61           Blue


if I applied the dataset as to different models such as linear regression, SVM, KNN, etc.

will these model consider CountryCode and TaskType as numeric fields and treat them as continuous data?

Shall I One Hot Encode these features before using them?

what is the best way to handle this scenario?

• What language are you using? Aug 13 '19 at 19:52
• @fractalnature Python Aug 13 '19 at 22:20
• orges-leka.de/automatic_feature_engineering.html maybe relevant in your situation.
– user42229
Aug 31 '19 at 4:39