Machine Learning algorithms understand the numbers and not texts. Hence, all the “text” columns must be converted into “numerical” columns to make it understandable for the algorithm.

This is the story of transforming labels or categorical or text values into numbers or numerical values. In simple words,

Encoding is the process of transforming words into numbers

In Python, OneHot Encoding and Lebel Encoding are two methods for encoding the categorical columns into numerical columns. And these are part of one of the most commonly used Python library: Scikit-Learn

But wait, you don’t want to import Scikit-Learn in your notebook ??

No problem at all, ⚡️ Pandas comes for your help.

Let us dive into this story of converting categorical variables into numerical ones so that ML algorithm understands it.

#python #education #data-science #machine-learning

Label Encoder and OneHot Encoder in Python
2.75 GEEK