-
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
UniqueCombination constraint with numerical values #434
Comments
I'm able to reproduce using this test set. This limitation isn't mentioned in the docs, so I'm not sure if this is a bug in the code or docs. If it's the latter, we can turn this into a feature request. My workaround was to recast the columns as strings, so they become categorical. constraint = UniqueCombinations(
columns=['name', 'age'],
handling_strategy='transform')
model = GaussianCopula(constraints=[constraint])
# need to recast before fitting the model
table['age'] = table['age'].astype(str)
model.fit(table) Out of curiosity, could you provide more details about your use case? I can think many scenarios where categorical strings are
|
I would consider this a feature request. It was already requested on #196 too, btw, so if we agree that we are talking about the same I would flag this one as a duplicate and close, in favor of the other one.
There could be a scenario in which there are unique combinations of products and prices. For example, think about a table that contains hotel reservations that include the columns |
Environment details
Problem description
Is it possible to use the UniqueCombination constraint with numerical columns on CTGAN? I tried to use it, but it shows an error:
Can only use .str accessor with string values!
when I try to fit the model.What I already tried
I specified the fields types:
field_types = { "Duracao do Acordo Informada": {"type": "numerical", "subtype": "float"}, "Duracao do Acordo Efetiva": {"type": "numerical", "subtype": "float"}, "Situacao do Acordo": {"type": "numerical", "subtype": "float"} }
and then created the constraint:
acordo_constraints = UniqueCombinations(columns=['Duracao do Acordo Informada', 'Duracao do Acordo Efetiva', 'Situacao do Acordo'], handling_strategy='transform')
constraints = [acordo_constraints]
and created the model:
model = CTGAN(epochs=100, field_types = field_types, constraints = constraints)
The text was updated successfully, but these errors were encountered: