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

Improve the way we print an individual transformer #395

Closed
npatki opened this issue Feb 16, 2022 · 0 comments
Closed

Improve the way we print an individual transformer #395

npatki opened this issue Feb 16, 2022 · 0 comments
Assignees
Labels
feature request Request for a new feature
Milestone

Comments

@npatki
Copy link
Contributor

npatki commented Feb 16, 2022

Problem Description

Users who are inspecting a transformer want to know the hyperparameters that are being used to create it. To improve usability, we should improve the way each individual transformer is printed.

Expected behavior

Every individual transformer should print:

  • name of the transformer
  • hyperparameters used to create it (ie all hyperparameters that are not the default)

Goal: User should know exactly how to create that object.

# Default: No parameters are printed because they are all defaults
>>> from transformers.numerical import FloatFormatter
>>> default_transformer = FloatFormatter()
>>> print(default_transformer)
<FloatFormatter()>

# Overriding parameter(s): Only print the overridden parameter(s)
>>> from transformers.boolean import BinaryEncoder
>>> transformer = BinaryEncoder(missing_value_replacement='mode')
>>> print(transformer)
<BinaryEncoder(missing_value_replacement="mode")>

Additional context

One motivation for this change is the HyperTransformer. When it returns the (first) transformer for each column, it will be nice if users can see which transformers are being used.

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

No branches or pull requests

2 participants