ML newbie here, currently looking at a binary classification problem. I have quite a good number of training data (easily over 50k) which consists of both numeric and categorical data. The categorical data consists of both ordinal and nominal types.
Here's the problem. I am unsure of what is the most proper way of encoding the categorical data, and what are the factors I should consider when deciding the encoding method. I have came across several encoding methods, which can be summarized in this article.
As additional information, I am thinking of using logistic regression and random forest as my first test classifiers. I have read that certain encoding methods are more suitable for certain types of classifiers. Hope to have more insight on that matter as well.
I hope that you guys/girls can lend me a helping hand. Thank you very much in advance.
EDIT
Due to P&C, I cannot share instances of the data, however these are examples of the categorical features, and the number of different data for each feature:
- Country (nominal) (40)
- Job Grade (ordinal) (8)
- Year/Quarter Joined (can be ordinal or nominal) (15)
- Department/Business Unit (nominal) (10)
Library used: scikit-learn
factor()
andordinal()
to convert variables, so there must be something similar in Python too. As to which variables is which is something that you have to figure out, which will be more useful. $\endgroup$