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

Always create a sample size of 1 no matter how small the scale. #2062

Merged
merged 3 commits into from
Jun 14, 2024

Conversation

lajohn4747
Copy link
Contributor

resolves #2045
CU-86b0reety

Make sure that the minimum size of root tables of 1 is used for sampling of small scales to avoid errors. Throw a warning that sample size should be bigger for better quality data as cardinality will likely no be accurate.

@lajohn4747 lajohn4747 requested a review from a team as a code owner June 13, 2024 04:56
@sdv-team
Copy link
Contributor

synthesizer = self._table_synthesizers[table]
LOGGER.info(f'Sampling {num_rows} rows from table {table}')
sampled_data[table] = self._sample_rows(synthesizer, num_rows)
self._sample_children(table_name=table, sampled_data=sampled_data, scale=scale)

if send_min_sample_warning:
warn_msg = (
"The 'scale' parameter it too small. Some tables may have 1 row."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: "The 'scale' parameter it too small." -> "The 'scale' parameter is too small."

Copy link
Member

@fealho fealho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you verify that this doesn't break the _enforce_table_size method?

@lajohn4747
Copy link
Contributor Author

lajohn4747 commented Jun 14, 2024

Can you verify that this doesn't break the _enforce_table_size method?

Added a unit test to show _enforce_table_size

@lajohn4747 lajohn4747 requested a review from fealho June 14, 2024 15:18
@lajohn4747 lajohn4747 merged commit a8c45ac into main Jun 14, 2024
39 checks passed
@lajohn4747 lajohn4747 deleted the issue_2045_scale_on_small branch June 14, 2024 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HMA Synthesizer's scale parameter doesn't work for small values
4 participants