# Nominal categorical variable with two levels: Label Encoding or One Hot encoding?

For a nominal categorical variable that has two levels, e.g. Gender (levels = Male,Female), is it feasible to use label encoding instead of One Hot encoding ? If it is, are there any implications of using one encoding method over the other, for such a categorical variable ?

• If there're only two levels, the ordering doesn't matter. Reordering the levels would just change the variable from is_female to is_male. You'd interpret the coefficient slightly differently and the intercept/bias would change as well to accommodate it, but that's really it. Try it out on some toy data and see what happens. Feb 23, 2018 at 22:37