We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
sample_remaining_columns()
Let's make sampling more user friendly. We can create multiple methods for different user needs.
A new sample_remaining_columns() method can address conditional sampling with a given Dataframe.
Parameters:
known_columns
max_tries
batch_size_per_try
randomize_samples
>>> model.sample_remaining_columns(known_columns=my_dataframe)
Running out of tries
# Always gracefully reject sample (ie return any rows that are sampled) >>> synthetic_data = model.sample_remaining_columns(known_columns=my_dataframe) Warning: Only able to sample 75 of the requested rows. To sample more rows, try increasing max_tries (currently: 100) or increasing batch_size_per_try (currently: 10000). Note that increasing these values will also increase the sampling time. # Error if we weren't able to sample any rows >>> synthetic_data = model.sample_remaining_columns(known_columns=my_dataframe) Error: Unable to sample any rows for the given conditions. Try increasing max_tries (currently: 100) or increasing batch_size_per_try (currently: 10000). Note that increasing these values will also increase the sampling time.
Checking for invalid input
# Unexpected column name >>> synthetic_data = model.sample_remaining_columns(known_columns=invalid_dataframe) Error: Unexpected column name 'New_Column'. Use a column name that was present in the original data. # Unexpected categorical column value >>> synthetic_data = model.sample_remaining_columns(known_columns=invalid_dataframe_2) Error: Unexpected value 'NEW_VALUE' in column 'New_Column'. Use a value that was present in the original data.
The text was updated successfully, but these errors were encountered:
CustomConstraint
GaussianCopula
katxiao
Successfully merging a pull request may close this issue.
Problem Description
Let's make sampling more user friendly. We can create multiple methods for different user needs.
A new
sample_remaining_columns()
method can address conditional sampling with a given Dataframe.Expected behavior
Parameters:
known_columns
: A pandas.DataFrame with the columns that are already known -- this specifies number of rowsmax_tries
: renamed from existing max_retries param (default: 100)batch_size_per_try
: Number of rows to sample per try (default: 10x requested num)randomize_samples
will determine whether or not there should be a fixed seed (default: True)Error Handling
Running out of tries
Checking for invalid input
The text was updated successfully, but these errors were encountered: