-1
$\begingroup$

We use one hot encoding with nominal variables so that we don't impose any order relationship. If we have a categorical variable that has three categories: Red, Blue, Green. The one hot encoding of this variable will be : Blue --> [1,0,0], Green --> [0,1,0] and Red --> [0,0,1]. Now, if we convert these binary numbers back to decimal numbers, we will have: Blue --> 4, Green --> 2 and Red --> 1, which has natural ordering relationship , so how one hot encoding doesn't introduce natural ordering relationship ?

$\endgroup$

1 Answer 1

3
$\begingroup$

You're confusing binary encoding with one hot encoding (OHE): there's no reason to interpret the array of 3 binary variables [0,1,0] as a single binary number. The 3 values are interpreted by any ML model as 3 different features.

For example if we call these 3 distinct features A, B, C you could see a condition B==1 in the node of a decision tree, leading to two nodes corresponding only to true (b=1) and false (B=0).

$\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.