In this blog, we will see, What are Nominal Encoding and Ordinal Encoding in the Data Science domain.
When we are working on some of the datasets, we found that some of the features are categorical. We all know that machines can’t understand categorical data. Models only work with numerical values. For this reason, it is necessary to convert the categorical values of the features into numerical ones, So the machine can learn from those data and gives the right model. This process of converting categorical data into numerical data is called Encoding.
There are two most popular types of encoding,
- Nominal Encoding
When we have a feature where variables are just names and there is no order or rank to this variable's feature.

For example: City of person lives in, Gender of person, Marital Status, etc…
In the above example, We do not have any order or rank, or sequence. All the variables in the respective feature are equal. We can't give them any orders or ranks. Those features are called Nominal features.
2. Ordinal Encoding
When we have a feature where variables have some order/rank.

For example: Student’s performance, Customer’s review, Education of person, etc…
In the above example, we have orders/ranks/sequences. We can assign ranks based on student’s performance, based on feedback given by customers, based on the highest education of the person. Those features are called Ordinal features.
Conclusion:
Encoding is a required pre-processing step when working with categorical data.
Comments
Post a Comment