Principle:Sdv dev SDV Constraint Integration
| Knowledge Sources | |
|---|---|
| Domains | Data_Quality, Synthetic_Data |
| Last Updated | 2026-02-14 00:00 GMT |
Overview
A registration mechanism that attaches constraint objects to a synthesizer, enabling constraint-aware data transformation during fitting and sampling.
Description
Constraint integration bridges the gap between constraint definition and synthesizer execution. When constraints are added to a synthesizer, the system determines whether each constraint can be enforced through data transformation (chained constraints) or must use reject sampling (reject-sampling constraints). Chained constraints modify the data before model fitting and reverse the modification after sampling. Reject-sampling constraints filter invalid rows from generated data.
Usage
Call add_constraints on a synthesizer with a list of constraint objects before calling fit.
Theoretical Basis
- Constraint classification: Each constraint attempts to update the metadata; if successful, it becomes a chained constraint; if it raises ConstraintNotMetError, it falls back to reject sampling
- Chained constraints: Transform data before fitting, reverse-transform after sampling
- Reject-sampling constraints: Filter invalid rows after sampling, with batch retries