-
Notifications
You must be signed in to change notification settings - Fork 396
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Computation of target encoding with only 1 positive example #275
Comments
Hi @joaquinvanschoren Another explanation that just crossed my mind is that the documentation for the |
This kinda makes sense but it is not consistent with the paper. |
Agree that not including the special case and updating the default value makes more sense, and it would be easier to know what to expect. I am using the code to explain target encoding to students, and the unexpected result makes that a lot harder :) |
Expected Behavior
I would expect the target encoding to follow the definition in the paper:
https://dl.acm.org/doi/10.1145/507533.507538
Actual Behavior
There is an extra line of code that, after the computation of the encoding, sets the encoding value equal to the prior when there is only one positive example (one example of a certain category with positive class)
This is the line:
category_encoders/category_encoders/target_encoder.py
Line 176 in a810a4b
Where does this come from? I can't seem to find this anywhere in the paper.
Thanks!
The text was updated successfully, but these errors were encountered: