I have a set of medical records, one of the columns has the name of 2000 different doctors. What do I need to do in order to convert these strings to numbers? I want to use a decision tree.
You’ll use two new binary features and use one hot encoding. For example, for Dr. A your features will be [1,0], and for Dr. B your features will be [0,1]. Assigning arbitrary numbers to each doctor is not the correct approach because it induces an implicit ordering, i.e. normally you don’t have Dr. A < Dr. B but depending on your assigned numbers, you’ll end up with comparable doctors, but you shouldn’t have.
Specifically for decision trees, most libraries don't require you to convert your categorical features into numeric. So, you should be able to use them as is.