Articles → MACHINE LEARNING → One-Hot Encoding And Label Encoding In Machine Learning

One-Hot Encoding And Label Encoding In Machine Learning






One-Hot Encoding








  1. Red
  2. Green
  3. Blue


ColorRedGreenBlue
Red100
Green010
Blue001



Label Encoding





Difference


One-Hot EncodingLabel Encoding
Creates a binary column for each category.Sequential numbers are assigned to each category.
As each category is assigned either 0 or 1. So, the unique number is not assigned.A unique number is assigned to each category.
The encoding is used when categories are independent of each other, like Red, Green, Blue, etc.Creates a false sense of order among the categories like Low < Medium < High.





Posted By  -  Karan Gupta
 
Posted On  -  Tuesday, October 28, 2025

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250