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

Update CategoricalTransformer to make it user friendly #364

Closed
npatki opened this issue Jan 26, 2022 · 0 comments · Fixed by #386
Closed

Update CategoricalTransformer to make it user friendly #364

npatki opened this issue Jan 26, 2022 · 0 comments · Fixed by #386
Assignees
Labels
feature request Request for a new feature
Milestone

Comments

@npatki
Copy link
Contributor

npatki commented Jan 26, 2022

Problem Description

Let's update CategoricalTransformer to make it more user friendly.

Expected behavior

Name: FrequencyEncoder
Functionality:

>>> from transformers.categorical import FrequencyEncoder
# (default) No noise
>>> fe = FrequencyEncoder() 

>>> fe = FrequencyEncoder(add_noise=True)
>>> fe.fit(data, column='categorical_column')

# if the transform contains new categories unseen during fit
>>> fe.transform(data_new_categories)
Warning: The data contains new categories ('hello', 'world') that were not in the original data.
Assigning them random values. If you want to model new categories, please fit the transformer
again with the new data.

# reverse transform: always clip without warning (ie never use modulo)
>>> fe.reverse_transform(model_data)
@npatki npatki added the feature request Request for a new feature label Jan 26, 2022
@amontanez24 amontanez24 added this to the 1.0.0 milestone Feb 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Request for a new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants