0

What is the need of converting integer encoding to binary encoding? I have checked different websites, textbooks but couldn't get what exactly it does and what is the need. We have categorical data and we can convert it to integer so far so good. However, what is the need for binary encoding?

I have check the answer at Why does one hot encoding improve machine learning performance? However, it's still not clear. It says we can get their own weights but wasn't that possible even if we had integer value?

petezurich
  • 9,280
  • 9
  • 43
  • 57
Gurjas Singh
  • 19
  • 1
  • 6

1 Answers1

0

If you encode i.e. categorical variables A, B, C to integers 1, 2, 3 many classifiers will «assume» that A (=1) is less than B (=2) or C (=3). This simply is a wrong assumption about the relationship of your categoricals.

Therefore you have to one hot encode.

petezurich
  • 9,280
  • 9
  • 43
  • 57
  • 1
    At last, an answer that really meant something. Thank you so much. – Gurjas Singh Sep 07 '18 at 10:57
  • @GurjasSingh You're welcome! :0) And in the same context you may have a look into the so called *dummy variable trap* eg. https://stackoverflow.com/questions/51914169/dummy-variable-in-multiple-linear-regression – petezurich Sep 07 '18 at 11:31