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

Sampled values not unique if primary key is numerical #1109

Closed
amontanez24 opened this issue Nov 21, 2022 · 1 comment
Closed

Sampled values not unique if primary key is numerical #1109

amontanez24 opened this issue Nov 21, 2022 · 1 comment
Assignees
Labels
bug Something isn't working
Milestone

Comments

@amontanez24
Copy link
Contributor

Environment Details

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

  • SDV version: 1.0.0.dev
  • Python version: any
  • Operating System: any

Error Description

If the primary key is set to be sdtype numerical, then the values for that key aren't always unique when sampling. The primary key must always have unique values.

Steps to reproduce

test_data = pd.DataFrame(data={
    'primary_key': [0, 1, 2],
    'numerical_col': [1, 2, 3],
    'categorical_col': ['a', 'b', 'a'],
})

test_metadata = SingleTableMetadata()
test_metadata.detect_from_dataframe(test_data)
test_metadata.set_primary_key(column_name='primary_key')

synthesizer = CopulaGANSynthesizer(test_metadata)
synthesizer.fit(test_data)
synthesizer.sample(5)
@amontanez24 amontanez24 added the bug Something isn't working label Nov 21, 2022
@amontanez24 amontanez24 added this to the 1.0.0 milestone Nov 21, 2022
@amontanez24
Copy link
Contributor Author

amontanez24 commented Nov 21, 2022

should be solved by #1114

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants