8000 ENH Add `pos_label` parameter to `TargetEncoder` · Issue #27342 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content
8000

ENH Add pos_label parameter to TargetEncoder #27342

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

Open
lucyleeow opened this issue Sep 12, 2023 · 1 comment
Open

ENH Add pos_label parameter to TargetEncoder #27342

lucyleeow opened this issue Sep 12, 2023 · 1 comment

Comments

@lucyleeow
Copy link
Member

Describe the workflow you want to enable

Add a pos_label parameter to TargetEncoder to enable the user to specify which label should be the positive class when the target is binary.

Describe your proposed solution

Add a pos_label parameter that is passed to the LabelBinarizer pos_label parameter.

Describe alternatives you've considered, if relevant

No response

Additional context

Ref: #26674 (comment)

cc @ogrisel

@glemaitre glemaitre removed the Needs Triage Issue requires triage label Sep 16, 2023
@glemaitre
Copy link
Member

Indeed, it makes sense. I am also thinking that the current validation of LabelBinarizer is not support UX friendly since it accepts only Integral values. I assume that we should be able to pass any type of classes.

Then we could use the _check_pos_label_consistency and improve it as well by passing classes if already computed (to avoid calling np.unique) and also add an extra check that pos_label is in classes.

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

2 participants
0