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.