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 LabelEncodingTransformer to make it user friendly #366

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

Update LabelEncodingTransformer to make it user friendly #366

npatki opened this issue Jan 26, 2022 · 0 comments · Fixed by #382
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 LabelEncodingTransformer to make it more user friendly.

Expected behavior

Name: LabelEncoder
Functionality:

>>> from transformers.categorical import LabelEncoder

>>> le = LabelEncoder()
>>> le.fit(data, column='categorical_column')

# if the transform contains new categories unseen during fit
>>> le.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.

# if there is out-of-bounds data in the reverse, clip it silently
>>> le.reverse_transform(out_of_bounds_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