2
$\begingroup$

I have a dataset that has categorical features that I have transformed using target encoding.

After fitting the model, I'm using LIME on the fitted model to understand some of the individual predictions.

Because the categorical feature was transformed to numeric due to encoding the interpretations of LIME becomes shady.

Instead of saying something like odor = foul, it might say something like odor < 0.24, which makes no sense. enter image description here

What can I do about this?

$\endgroup$

1 Answer 1

-1
$\begingroup$

Are you using one hot ending or categorical encoding?

Country names do not have an order or rank. But, when label encoding is performed, the country names are ranked based on the alphabets. Due to this, there is a very high probability that the model captures the relationship between countries such as India < Japan < the US.

This is something that we do not want! So how can we overcome this obstacle? Here comes the concept of One-Hot Encoding!

See the link below for all details.

https://www.analyticsvidhya.com/blog/2020/03/one-hot-encoding-vs-label-encoding-using-scikit-learn/

$\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.