1
$\begingroup$

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?

$\endgroup$
1
  • 1
    $\begingroup$ What about Dummy coding? $\endgroup$
    – Michael M
    Commented Sep 25, 2013 at 20:23

1 Answer 1

1
$\begingroup$

The use of dummy coding (aka indicator variables) is probably your best bet. As you've mentioned, converting categorical variables to numerical ones not only assumes they have a clear ordering 1 (A) < 2 (B) < 3 (C), but also for many tasks that the "change" between A and B and B and C are equal, and half that of the change between A and C.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.