❖ ReferenceTable
Use the ReferenceTable constraint when you have a table that acts as an unchangeable reference. That is to say, you do not want to synthesize an new information in it; the table's contents should always remain as-is.
When you apply this constraint, the reference table's contents remains as-is. At the same time, synthetic data is generated for all other tables, including ones that link to the reference table.

City
table is a reference table. You do not want to synthesize new cities, but you do want to synthesize other tables that link to the cities such as Supplier
, Product
, etc.Constraint API
This functionality is in Beta. At this time, select SDV Enterprise users have been invited to use this feature.
Create a ReferenceTable
constraint
Parameters:
(required)
reference_table_names
: A list of strings representing all the reference tables that are in your schema.
from sdv.cag import ReferenceTable
my_constraint = ReferenceTable(
reference_table_names=['City'])
Make sure that all table names you provide are in your Metadata. Reference tables are not allowed to have any foreign key references to non-reference tables.
Usage
Apply the constraint to any SDV synthesizer. Then fit and sample as usual.
synthesizer = HSASynthesizer(metadata)
synthesizer.add_constraints([my_constraint])
synthesizer.fit(data)
synthetic_data = synthesizer.sample()
For more information about using predefined constraints, please see the Constraint-Augmented Generation tutorial.
Last updated