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

Adds capability to avoid passing unseen levels to rare #141

Merged
merged 9 commits into from
Dec 19, 2023

Conversation

TommyMatthews
Copy link
Contributor

@TommyMatthews TommyMatthews commented Nov 7, 2023

Parameter 'encode_unseen_levels' can be set to False. (default True).

If so, the levels present in the training data will be stored in during the fit method call. In transform, any new levels not present in the training data will be added to the mappings_ dictionary and thus not mapped to rare.

@davidhopkinson26
Copy link
Contributor

thanks @TommyMatthews! Please run the pre-commit hook to hopefully autofix the linting failures for Black and Ruff. If you use github codespaces this will all be set up automatically for you.

@TommyMatthews TommyMatthews marked this pull request as ready for review November 8, 2023 11:59
@davidhopkinson26 davidhopkinson26 linked an issue Dec 5, 2023 that may be closed by this pull request
@davidhopkinson26
Copy link
Contributor

Looks good @TommyMatthews. Please see above for a couple of nitpicking comments on var names and some redundant tests to remove but I think the solution implemented here is quite elegant and neat :)

@davidhopkinson26 davidhopkinson26 merged commit 71bbcc7 into develop Dec 19, 2023
1 check passed
@davidhopkinson26 davidhopkinson26 deleted the feature/rare_encoder_unseen_levels_fix branch March 21, 2024 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rare encoding unseen levels in fit
2 participants