Encoding categorical data is the process of transforming categorical data into integer format so that data with converted categorical values can be fed into various models.
All input and output variables in machine learning models must be numeric. This means that if your data is categorical, you'll need to convert it to numbers before fitting and evaluating a model.
Encoding is a method of turning categorical variables to numerical values so that a machine learning model may be easily fitted to them. Before we go into the details, it's important to grasp the many sorts of categorical variables.