Skip to main content
edited tags
Link
ttnphns
  • 58.8k
  • 53
  • 287
  • 512
Source Link
user1893354
  • 1.9k
  • 4
  • 20
  • 28

Converting categorical variables to numerical ones

I am working on a binary classification task where one of the input variables takes values in {A, B, C}. A lot of classifiers only take numerical attributes as inputs so I was wondering what the best way to do this is. If I just map them to integers like A:1, B:2, C:3, I am worried that this would mean that A is more similar to B and less similar to C (because |1-2|=1 and |1-3|=2) but that is not necessarily true. So won't this method introduce some sort of bias?