For the complete documentation index, see llms.txt. This page is also available as Markdown.

Exporting Synthetic Data

Export your synthetic data back into a similar format as the original data or into a new format using the functions describe on this page.

❖ Export to a Database

SDV Enterprise Bundle. This feature is available as part of the AI Connectors Bundle, an optional add-on to SDV Enterprise. For more information, please visit the AI Connectors Bundle page.

Write your synthetic data into a database to use for downstream applications. Many users choose to write to a database in a lower environment for testing and development. You can also append the synthetic data to an existing database.

We recommending using the same AI Connector you used for importing training data. This connector already knows your original database schema, so it will create the same schema when exporting synthetic data. Be sure to set your export config, so the connector knows where to write the synthetic data.

For more information, see Connect Your Database docs.

connector.set_export_config(...)
connector.export(data=synthetic_data, mode='write')

Exporting to a different type of database? Create a new connector based on the type of database. Then, set its export config and complete the export.

Write Locally

We recommend using the same data handler that you used for importing training data. This writes multiple files corresponding to each table you have synthesized. For more information, see the Import Local Data docs.

connector.write(
  synthetic_data,
  folder_name='project/synthetic_data',
  to_csv_parameters={
      'encoding': 'latin-1',
      'index': False
  }
  mode='x')
)

Write to a different type of file? Create a new handler based on the desired file format and then perform the write.

Write other file formats directly from pandas. The SDV uses the pandas library for data manipulation and synthesizing. Pandas offers native support for many other types of files. For more information, see the pandas reference.

If you have a multi-table dataset, be sure to iterate through all the tables of your multi-table dataset. Pandas typically writes one table at a time.

Last updated