Label Encoding

  • also called Integer Encoding
  • Each unique category is assigned an integer value
  • e.g. “red” → 0, “blue” → 1, …
  • easy reversible
  • can only be used when a ordinal relationship between the labels exist, e.g. winner ranking in string (“first”, “second”, “third”)
    • if not and still used, can result in poor performance and unexpected results
  • numeric representations have a natural ordered relationship between each other and the models are able to understand that relationship