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?


1 Answer 1


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.



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.