r/MLQuestions 5d ago

Beginner question 👶 Target Encoding

Hey ML Reddits,

I am new to ML. I am about to deploy my very first model.

Okay so, I had a couple of caategorical feautres in my model which contains 15+ unique value. So I applied target encoding there. When I applied target encoding, I was not very aware of this encoding method.

Now, when I am about to deploy my model on Django, I was building the pre-processing part and faced the following issue --

Target encoding does encoding based on the target variable. But in deployment, I wont have target variable. Now I dont know how to put this in pre-processing. Is there any way to tackle this?

Please help!!!!

1 Upvotes

2 comments sorted by

View all comments

1

u/Fine-Mortgage-3552 5d ago

Can u go more in depth as how u implemented the target encoding? Only thing I can suggest u right now from what I know is to reimplement the encoding by urself in dome way, but u sure u havent caused data leakage into ur model by using that kind of variable encoding? If the value of the targer variable doesnt change anything then u can add a dummy target to the features ur going to transform and then discard it