Compatibility: A single, numerical column

The Negative constraint enforces that all the values in a given column are <0.

Some models already learn the min and max values of every column in the real dataset and enforce the bounds in the synthetic dataset. For such models, you do not need to add this constraint.


(required) column_name: The name of the column that must follow the constraint

strict_boundaries: Whether the column must be strictly negative, or whether 0 is allowed


All values in the column are <0

(default) False

All values in the column are ≤0


Define your constraint using the parameters and then add it to a synthesizer.

my_constraint = {
    'constraint_class': 'Negative',
    'table_name': 'credit_statements', # for multi table synthesizers
    'constraint_parameters': {
        'column_name': 'credit_balance',
        'strict': False



What happens to missing values?

This constraint ignores missing values. The constraint considered is valid as long as the numerical values (non-missing values) follow the logic.

Last updated

Copyright (c) 2023, DataCebo, Inc.