-
Notifications
You must be signed in to change notification settings - Fork 320
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
Giving user an ability to write general constraints as functions #411
Comments
Hey, could you let me know, what code your Positives constraints has. If i understand correctly i would have to add a custom constraint in the tabular.py. I am just looking for a constraint, that will create synth data which only has positive values. thx |
I noticed that you can use a repeated For eg, this works (but needs to be repeated for every column): def age_is_pos(data):
return data['age'] > 0
age_is_pos_constraint = CustomConstraint(is_valid=age_is_pos) However, this throws an error when modeling: age_is_pos = lambda data: data['age'] > 0
age_is_pos_constraint = CustomConstraint(is_valid=age_is_pos) I also can't create shortcuts (same error): def get_pos_fn(col_name):
def fn(data):
return data[col_name] > 0
return fn
age_is_pos = get_pos_fn('age')
CustomConstraint(is_valid=age_is_pos) |
I've tried to use the suggestions of @npatki when modeling and the GaussianCopula model is fitting correctly. Here the error:
Any suggestions? |
Could you spin up another issue for the issue with
We're aware that there's an increasing demand for this feature. Stay tuned, and we'll provide an update when they're available in a future release! For the |
Hi @npatki , Can we use the general constraint functionality for relational data generation ? When can we except this functionality available. Thankyou. |
Constraints are available for relational data. See User Guide for details.
Yes, our plan is to add a |
Problem Description
Currently if we want to create a general purpose constraint to be able to use across multiple columns like this
We would have to write a
class
. Possible to design a way so user only writes afunction
and we can enable the same usage.[Note: will update this issue with more detail]
The text was updated successfully, but these errors were encountered: