You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
metadata = SingleTableMetadata()
for col in list(train):
metadata.add_column(column_name=col, sdtype='numerical', computer_representation='Float')
if os.path.exists("metadata.json"):
os.remove("metadata.json")
metadata.save_to_json(filepath='metadata.json')
synthesizer = CTGANSynthesizer(
metadata,
epochs=500,
verbose=True)
Hi @fyy623 glad you were able to fix it. Do feel free to file a new issue if you run into anything.
BTW I believe the issue was that you were passing in the metadata dictionary into CTGANSynthesizer. All SDV synthesizers expects you to pass in a SingleTableMetadata object, not a dictionary. For more info, you can see the resources below:
Below is the start of my code:
As I read through the document, there are two ways of creating metadata based on a dataframe.
One is using the sdv's built-in API:
The other is manually create a json object as metadata:
And either way, the metadata should be passed to
CTGANSyhthesizer
likeThe first auto-dectect method gives me an error that says:
AttributeError: 'NoneType' object has no attribute 'validate'
The seecond manual way raises an error that says:
AttributeError: 'str' object has no attribute 'validate'
Since both issues are probably related, I think it would be adequate to discuss them together.
My json object prints something like below:
The text was updated successfully, but these errors were encountered: