Skip to content

TargetEncoder should respect sample_weights #28881

Open
@mayer79

Description

@mayer79

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions