Currently I have a data-set with roughly 7 types of nominal data; these are things like "workclass" or "marital status". It is my understanding it is best to convert nominal data like this into numeric data. So, what I've done so far, as a simple experiment, is make up a dictionary for each nominal data type, so in our example of "marital status", it would be "Divorced":0, "Married":1, "Widowed":3, "Separated":4.
However, as I understand, there are some problems with this approach, as it implies that Divorced->Married are more related than Divorced->Widowed. I tried to arrange this data into a logical pattern, but for a lot of it its impossible. So here are my questions:
- Is there a good approach to do this without running into the above problem, specifically in Python? I'm using Pandas DF's at the moment, and I saw an example online of something called Binary Vectorizers, but I'm not sure if that won't introduce too many attributes/columns to my data set.
- When I convert a nominal value to an interval one, do I replace the original (For example Workclass) with the Workclass_Number data? Do I only enter the number data into my models?
- Are there any guidelines on the numbers that should be used? For example I used simple intervals of 1 for all of my data, starting at 0.