Add CategoricalEncoder combining OneHotEncoder and TargetEncoder - #2244
Draft
faithlesstomas wants to merge 5 commits into
Draft
Add CategoricalEncoder combining OneHotEncoder and TargetEncoder#2244faithlesstomas wants to merge 5 commits into
faithlesstomas wants to merge 5 commits into
Conversation
This encoder combines OneHotEncoder and TargetEncoder as described in skrub-data#2065 issue.
faithlesstomas
force-pushed
the
categorical-encoder
branch
from
August 5, 2026 15:58
b2700b9 to
b7a52c9
Compare
faithlesstomas
marked this pull request as draft
August 5, 2026 16:04
faithlesstomas
force-pushed
the
categorical-encoder
branch
from
August 5, 2026 16:36
49c27f5 to
2953336
Compare
Member
|
thanks a lot @faithlesstomas !! for context, @faithlesstomas started working on this as part of the EuroScipy 2026 sprint. (just so you know a few maintainers including myself are currently on vacation so review may be a bit slower than usual) |
9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
New Feature Pull Request
Description
This PR introduces
CategoricalEncoder, a single-column transformer that combinesOneHotEncoder(for encoding frequent categories into one-hot binary columns) andTargetEncoder(for encoding categories using the target variabley).Fixes #2065
Checklist
If the feature inherits from
SingleColumnTransformer:get_feature_names_outhas been implementedHow Has This Been Tested?
skrub/tests/test_categorical_encoder.pycovering:yis missing (y=None).one_hot_encoderortarget_encoderinstances are provided.ApplyToCols.check_is_fitted,clone).pytest skrub/tests/test_categorical_encoder.pyandpytest skrub/tests/test_single_column_transformer.py).ruff check.Example Usage