Skip to content
AI360Xpert
Glossary
Definition

Label Encoding

A data preprocessing technique that converts categorical text variables into integer values so they can be processed by machine learning algorithms.

Think of It Like This

Like assigning a unique jersey number to every player on a sports team so the referee can easily log penalties.

While highly efficient for memory, standard label encoding imposes an artificial ordinal relationship on the data (e.g., Apple=1, Banana=2 implies Banana > Apple). This can severely confuse models like linear regression. It is best suited for inherently ordinal data or tree-based algorithms that can partition integers effectively.