PARSynthesizer
The PARSynthesizer
uses a deep learning method to train a model and generate synthetic data.
Is the PARSynthesizer suited for your dataset? The PARSynthesizer is designed to work on multi-sequence data, which means that there are multiple sequences (usually belonging to different entities) present within the same dataset. This means that your metadata should include a sequence_key
. Using this information, the PARSynthesizer creates brand new entities and brand new sequences for each one.
If your dataset contains only a single sequence of data, then the PARSynthesizer is not suited for your dataset.
Creating a synthesizer
When creating your synthesizer, you are required to pass in a Metadata object as the first argument. All other parameters are optional. You can include them to customize the synthesizer.
Parameter Reference
enforce_min_max_values
: Control whether the synthetic data should adhere to the same min/max boundaries set by the real data
(default) | The synthetic data will contain numerical values that are within the ranges of the real data. |
| The synthetic data may contain numerical values that are less than or greater than the real data. Note that you can still set the limits on individual columns using Constraints. |
enforce_rounding
: Control whether the synthetic data should have the same number of decimal digits as the real data
(default) | The synthetic data will be rounded to the same number of decimal digits that were observed in the real data |
| The synthetic data may contain more decimal digits than were observed in the real data |
locales
: A list of locale strings. Any PII columns will correspond to the locales that you provide.
(default) | Generate PII values in English corresponding to US-based concepts (eg. addresses, phone numbers, etc.) |
| 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 For all options, see the Faker docs. |
context_columns
: Provide a list of strings that represent the names of the context columns. Context columns do not vary inside of a sequence. For example, a user's 'Address'
may not vary within a sequence while other columns such as 'Heart Rate'
would. Defaults to an empty list.
epochs
: Number of times to train the GAN. Each new epoch can improve the model.
(default) | Run all the data through the neural network 128 times during training |
| Train for a different number of epochs. Note that larger numbers will increase the modeling time. |
verbose
: Control whether to print out the results of each epoch. You can use this to track the training time as well as the improvements per epoch.
(default) | Do not print out any results |
| Print out the loss value per epoch. The loss values indicate how well the neural network is currently performing, lower values indicating higher quality. |
cuda
: Whether to use CUDA, a parallel computing platform that allows you to speed up modeling time using the GPU
(default) | If available, use CUDA to speed up modeling time. If it's not available, then there will be no difference. |
| Do not use CUDA to speed up modeling time. |
Looking for more customizations? Other settings are available to fine-tune the architecture of the underlying neural network used to model the data. Click the section below to expand.
get_parameters
Use this function to access the custom parameters you have included for the synthesizer
Parameters None
Output A dictionary with the parameter names and the values
The returned parameters are a copy. Changing them will not affect the synthesizer.
get_metadata
Use this function to access the metadata object that you have included for the synthesizer
Parameters None
Output A Metadata object
The returned metadata is a copy. Changing it will not affect the synthesizer.
Learning from your data
To learn a machine learning model based on your real data, use the fit
method.
fit
Parameters
(required)
data
: A pandas DataFrame object containing the real data that the machine learning model will learn from
Output (None)
Technical Details: PAR is a Probabilistic Auto-Regressive model that is based in neural networks. It learns how to create brand new sequences of multi-dimensional data, by conditioning on the unchanging, context values.
For more details, see the Sequential Models in the Synthetic Data Vault, a preprint from June 2022 that describes the PAR model.
Saving your synthesizer
Save your trained synthesizer for future use.
save
Use this function to save your trained 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
PARSynthesizer.load
Use this function to load a trained synthesizer from a Python pickle file
Parameters
(required)
filepath
: A string describing the filepath of your saved synthesizer
Output Your synthesizer, as a PARSynthesizer object
What's next?
After training your synthesizer, you can now sample synthetic data. See the Sampling section for more details.
Want to improve your synthesizer? Customize the transformations used for pre- and post-processing the data. For more details, see Advanced Features.
FAQs
Last updated