ClampingBounds#

from tmlt.synthetics import ClampingBounds
class tmlt.synthetics.ClampingBounds(bounds_per_column, weight=0)#

Bases: object

A configuration for clamping bounds of each numeric column to generate.

ClampingBounds can be explictly provided or set to be automatically discovered using DP.

property weight: int#

How much privacy budget should be used to discover bounds.

property bounds_per_column: Dict[str, Tuple[float, float] | PerGroupClampingBounds | AutomaticBounds]#

Returns the dictionary mapping column names to clamping bounds.

__getitem__(column)#

Returns clamping bounds for a column.

If the bounds for column are specified to be distinct per group, this method returns a PerGroupClampingBounds object. Otherwise, it returns a tuple (low, high).

If the bounds for column is set to be automatically discovered, this method will raise an error unless the bounds have been discovered by calling the discover_unknown_bounds method first.

Parameters:

column (str) – The name of the column for which to get the clamping bounds.

Return type:

Union[Tuple[float, float], PerGroupClampingBounds]

discover_unknown_bounds(session, source_id, budget, keysets)#

Discover clamping bounds for columns with AutomaticBounds.