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

Add documentation for fit_column_model and update default #549

Merged
merged 2 commits into from
Aug 13, 2021

Conversation

katxiao
Copy link
Contributor

@katxiao katxiao commented Aug 6, 2021

Add documentation for fit_column_model and change the default value to False. Also add a warning for when reject sampling may take a long time

Resolves #517, #522, and #550

@katxiao katxiao changed the title Add documentation for fit_column_model Add documentation for fit_column_model and update default Aug 6, 2021
@katxiao katxiao force-pushed the sdv-issue-517-fit-columns-model-doc branch from 4bfa5d0 to 234b826 Compare August 6, 2021 19:39
@katxiao katxiao requested review from csala and amontanez24 August 6, 2021 21:12
@katxiao katxiao marked this pull request as ready for review August 6, 2021 21:12
@@ -226,6 +227,14 @@ def _validate_constraint_columns(self, table_data):
"""
missing_columns = [col for col in self.constraint_columns if col not in table_data.columns]
if missing_columns:
if not self._columns_model:
warning_message = (
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we add a small unit test for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I just added it!

Copy link
Contributor

@amontanez24 amontanez24 Aug 11, 2021

Choose a reason for hiding this comment

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

Now that I look at this, I wonder if it is confusing to a user. @csala The case where this happens is usually because of conditioning right? Would they be confused to see a warning that says "constraints are missing from table data". Should we say that it's because of conditioning to provide more context?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hm that's a good point. I didn't completely understand the use case when I wrote this message.

I can update the comment to say, "When fit_columns_model is False and we are conditioning on a subset of the constraint columns, reject sampling can become slow."

What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think that makes sense

Copy link
Contributor

@amontanez24 amontanez24 left a comment

Choose a reason for hiding this comment

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

This looks good but I have a question about the warning message that I'd like to clarify before merging

@@ -226,6 +227,14 @@ def _validate_constraint_columns(self, table_data):
"""
missing_columns = [col for col in self.constraint_columns if col not in table_data.columns]
if missing_columns:
if not self._columns_model:
warning_message = (
Copy link
Contributor

@amontanez24 amontanez24 Aug 11, 2021

Choose a reason for hiding this comment

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

Now that I look at this, I wonder if it is confusing to a user. @csala The case where this happens is usually because of conditioning right? Would they be confused to see a warning that says "constraints are missing from table data". Should we say that it's because of conditioning to provide more context?

tests/unit/constraints/test_base.py Outdated Show resolved Hide resolved
@katxiao katxiao force-pushed the sdv-issue-517-fit-columns-model-doc branch from c16bcd2 to 2d03720 Compare August 12, 2021 13:17
@katxiao katxiao force-pushed the sdv-issue-517-fit-columns-model-doc branch from 2d03720 to 39af260 Compare August 12, 2021 17:10
Copy link
Contributor

@amontanez24 amontanez24 left a comment

Choose a reason for hiding this comment

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

Thanks for addressing! LGTM!

@katxiao katxiao merged commit 12277be into master Aug 13, 2021
@katxiao katxiao deleted the sdv-issue-517-fit-columns-model-doc branch August 13, 2021 17:17
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.

Add explanation of fit_columns_model to API docs
3 participants