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

Create Condition object #689

Closed
npatki opened this issue Jan 26, 2022 · 0 comments · Fixed by #712
Closed

Create Condition object #689

npatki opened this issue Jan 26, 2022 · 0 comments · Fixed by #712
Assignees
Labels
data:single-table Related to tabular datasets feature request Request for a new feature
Milestone

Comments

@npatki
Copy link
Contributor

npatki commented Jan 26, 2022

Problem Description

Let's making sampling more user friendly. Let's create a Condition object to use for conditional sampling.

Expected behavior

A Condition is defined by a set of column_name, column_value pairs and an optional num_rows parameter

from sdv.tabular.sampling import Condition

female_users = Condition(column_values={'sex': 'F', 'active_user': True}, num_rows=50)

# default of num_rows is 1
inactive_user = Conditions(column_values={'active_user': False})

# use loops to create multiple conditions
retired_users = []
for age in range(65, 90):
   condition = Condition(column_values={'age': age}, num_rows=1)
   retired_users.append(condition)

See issue #691 for how to use this object when conditionally sampling

@npatki npatki added feature request Request for a new feature data:single-table Related to tabular datasets labels Jan 26, 2022
@katxiao katxiao self-assigned this Mar 3, 2022
@katxiao katxiao closed this as completed Mar 4, 2022
@katxiao katxiao added this to the 0.14.0 milestone Mar 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data:single-table Related to tabular datasets feature request Request for a new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants