Converting Categorical Variables to Numerical Values | Label Encoding

preview_player
Показать описание
We have shown here two ways to convert categorical variables or Label Encoding. One with Scikit-learn's LabelEncoder utility class And another way is, using Numpy where() Method.

LabelEncoder class encodes target labels with a value between 0 and the number of variables-1. This transformer should be used to encode the target variable, Y, and not the input data, X.

The Numpy where() method is especially good for encoding where there are only two types of categorical variables.

#CS #AI #MachineLearning #ML
_____________________________________________________

Рекомендации по теме
Комментарии
Автор

label encoding i am facing error i have two instance 1.abc_yahoo 2.abc_1234.google while trying to convert in one hot encoding the result coming with more than 2 different values . please help

amitpadhi