* DayZSynthesizer
The Day Z Synthesizer produces synthetic data from scratch using the metadata. This allows you start generating synthetic data from day zero: no machine learning required!
from sdv.multi_table import DayZSynthesizer
synthesizer = DayZSynthesizer(metadata)
synthetic_data = synthesizer.sample_scale(scale=1.0)Creating a synthesizer
When creating your synthesizer, you are required to pass in a Metadata object as the first argument. We also recommend setting the parameters at this time.
synthesizer = DayZSynthesizer(
metadata,
locales=['en_US', 'en_CA', 'fr_CA']
)Parameter Reference
locales: A list of locale strings. Any PII columns will correspond to the locales that you provide.
(default) ['en_US']
Generate PII values in English corresponding to US-based concepts (eg. addresses, phone numbers, etc.)
<list>
Create data from the list of locales. Each locale string consists of a 2-character code for the language and 2-character code for the country, separated by an underscore.
For example ["en_US", "fr_CA"].
For all options, see the Faker docs.
Programmatic Parameters API
For even more realism, use the API below to set some additional parameters.
get_parameters
Use this function to access the all parameters your synthesizer uses -- those you have provided as well as the default ones.
Parameters
output_filepath: A string representing the name of the file to write the parameters to. We recommend storing this as a JSON file. Defaults toNone, meaning that no output filepath is written.
Output A dictionary with the table names and parameters for each table.
get_table_parameters
Use this function to access the all parameters a table synthesizer uses -- those you have provided as well as the default ones.
Parameters
(required)
table_name: A string describing the name of the table
Output A dictionary with the parameter names and the values
Saving your synthesizer
Save your synthesizer for future use
save
Use this function to save your synthesizer as a Python pickle file.
Parameters
(required)
filepath: A string describing the filepath where you want to save your synthesizer. Make sure this ends in.pkl
Output (None) The file will be saved at the desired location
load (utility function)
Use this utility function to load a trained synthesizer from a Python pickle file. After loading your synthesizer, you'll be able to sample synthetic data from it.
Parameters
(required)
filepath: A string describing the filepath of your saved synthesizer
Output Your synthesizer object
This utility function works for any SDV synthesizer.
What's next?
After training your synthesizer, you can now sample synthetic data. See the Sampling section for more details. (This synthesizer does not yet offer support for conditional sampling.)
Last updated