Skip to content
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

TargetEncoder should respect sample_weights #28881

Open
mayer79 opened this issue Apr 24, 2024 · 2 comments
Open

TargetEncoder should respect sample_weights #28881

mayer79 opened this issue Apr 24, 2024 · 2 comments

Comments

@mayer79
Copy link
Contributor

mayer79 commented Apr 24, 2024

Describe the workflow you want to enable

The current implementation of TargetEncoder seems to calculate (shrinked) averages of y. In cases with sample_weights, it would be more natural to work with (shrinked) weighted averages.

Describe your proposed solution

In case of sample_weights, shrinked averages should be replaced by corresponding shrinked weighted averages.

However, I am not 100% sure if sample_weights are accessable by a transformer.

Describe alternatives you've considered, if relevant

The alternative is to continue ignoring sample weights.

Additional context

No response

@mayer79 mayer79 added Needs Triage Issue requires triage New Feature labels Apr 24, 2024
@betatim betatim removed the Needs Triage Issue requires triage label Apr 25, 2024
@betatim
Copy link
Member

betatim commented Apr 25, 2024

In principle sample_weight can be accessed when fitting TargetEncoder. So at first sight this is something that can be considered as a new feature. There seems to be some support for it as well (👍 on the issue).

@ogrisel
Copy link
Member

ogrisel commented May 6, 2024

Related to #11316 for testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants