0
$\begingroup$

As the title says, When to use Label Encoder and One Hot encoding with target variables ?

$\endgroup$

2 Answers 2

0
$\begingroup$

This depends on the model being used and, probably more importantly, the software being used. I think most packages are perfectly content to get the raw targets, and will encode internally as needed.

$\endgroup$
-1
$\begingroup$

Both has its own advantages and disadvantages, One hot encoding doesnot assume any relationship between categories, but it takes each category as independent feature. Hence algorithm doesnot consider the ordering of the categorical features. Similarly, one hot encoding increases dimensionality for each categorical, hence sparse representation of data makes the dataset's dimension increased.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.