Skip to content

[SDV 2.0] Unify input/output for remaining synthesizer methods #3016

Description

@frances-h

Environment Details

Please indicate the following details about the environment in which you found the bug:

  • SDV version:
  • Python version:
  • Operating System:

Error Description

With SDV 2.0, we want to unify the input/output for synthesizers across all modalities. A few methods still need to be updated to return a dictionary instead of a dataframe:

  • SingleTableSynthesizer.sample_from_conditions
  • SingleTableSynthesizer.sample_remaining_columns
  • par.sample_sequential_columns

Additionally, these methods need to be updated to take the table_name parameter to be unified with multi table:

  • SingleTableSynthesizer.get_transformers
  • SingleTableSynthesizer.update_transformesr

Steps to reproduce

data, metadata = download_demo('single_table', 'fake_hotel_guests')

synthesizer = GaussianCopulaSynthesizer(metadata)
synthesizer.auto_assign_transformers()

room_type_transformer = OrderedLabelEncoder(
    order=['BASIC', 'DELUXE', 'SUITE'],
    add_noise=True
)

synthesizer.update_transformers(
  table_name='fake_hotel_guests',
  column_name_to_transformer={
    'room_type': room_type_transformer
})

synthesizer.fit(data)

condition = Condition(
    num_rows=10,
    column_values={'room_type': 'SUITE', 'has_rewards': True}
)

synthesizer.sample_from_conditions([condition])

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions