sdv.constraints.Range

class sdv.constraints.Range(low_column_name, middle_column_name, high_column_name, strict_boundaries=True)[source]

Ensure that the middle_column_name is between low and high columns.

The transformation strategy works by replacing the middle_column_name with a scaled version and then applying a logit function. The reverse transform applies a sigmoid to the data and then scales it back to the original space.

Parameters
  • low_column_name (str) – Name of the column which will be the lower bound.

  • middle_column_name (str) – Name of the column that has to be between the lower bound and upper bound.

  • high_column_name (str) – Name of the column which will be the higher bound.

  • strict_boundaries (bool) – Whether the comparison of the values should be strict >= or not > when comparing them.

__init__(low_column_name, middle_column_name, high_column_name, strict_boundaries=True)

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__(low_column_name, …[, …])

Initialize self.

filter_valid(table_data)

Get only the rows that are valid.

fit(table_data)

Fit Constraint class to data.

fit_transform(table_data)

Fit this Constraint to the data and then transform it.

from_dict(constraint_dict)

Build a Constraint object from a dict.

is_valid(table_data)

Say whether the constraint_column is between the low and high values.

reverse_transform(table_data)

Handle logic around reverse transforming constraints.

to_dict()

Return a dict representation of this Constraint.

transform(table_data)

Perform necessary transformations needed by constraint.

Attributes

constraint_columns