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

Pretty print get_config #450

Closed
npatki opened this issue Mar 23, 2022 · 0 comments
Closed

Pretty print get_config #450

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

Comments

@npatki
Copy link
Contributor

npatki commented Mar 23, 2022

RDT 1.0.0 (dev branch)

Problem Description

The new get_config method returns the config dictionary but can also be used to view the current config. In this case, we should consider ways to pretty print the config so it can be easily read. One way to do this: We could sub-class dictionary and override the print method.

Current behavior

Here is the get_config() method. It's hard for me to know where the transformers dictionary begins.

{'sdtypes': {'age': 'integer',
  'credit_card': 'categorical',
  'dollars_spent': 'float',
  'email_optin': 'boolean',
  'last_login': 'categorical'},
 'transformers': {'age': FloatFormatter(missing_value_replacement='mean'),
  'credit_card': FrequencyEncoder(),
  'dollars_spent': FloatFormatter(missing_value_replacement='mean'),
  'email_optin': BinaryEncoder(missing_value_replacement='mode'),
  'last_login': FrequencyEncoder()}}

Expected behavior

A good example of pretty printing a dictionary is the detect_initial_config method. It's much easier to parse the two dictionaries.

{
    "sdtypes": {
        "last_login": "categorical",
        "email_optin": "boolean",
        "credit_card": "categorical",
        "age": "integer",
        "dollars_spent": "float"
    },
    "transformers": {
        "last_login": "FrequencyEncoder()",
        "email_optin": "BinaryEncoder(missing_value_replacement='mode')",
        "credit_card": "FrequencyEncoder()",
        "age": "FloatFormatter(missing_value_replacement='mean')",
        "dollars_spent": "FloatFormatter(missing_value_replacement='mean')"
    }
}
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

3 participants