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

Conditional sampling doesn't work if the model has a CustomConstraint #696

Closed
npatki opened this issue Jan 27, 2022 · 0 comments · Fixed by #698
Closed

Conditional sampling doesn't work if the model has a CustomConstraint #696

npatki opened this issue Jan 27, 2022 · 0 comments · Fixed by #698
Assignees
Labels
bug Something isn't working data:single-table Related to tabular datasets
Milestone

Comments

@npatki
Copy link
Contributor

npatki commented Jan 27, 2022

Environment Details

  • SDV version: 0.13.1
  • Python version: 3.7

Error Description

Any time you create a tabular model using a CustomConstraint, you cannot sample it with conditions. (Sampling entire rows -- without conditions -- works.)

Currently, we only using reject sampling, so it should always be possible to sample an entire row and then filter out invalid conditions.

Steps to reproduce

Follow the code in issue #560 .

Current Workaround

It's possible to sample entire rows without constraints. So the workaround is to call sample(), and then manually delete any invalid rows that are returned. Note: It may take more tries to get the desired output, so you may want to try sampling a greater number of rows that you want.

Other notes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working data:single-table Related to tabular datasets
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants