opendp.comb module#

opendp.comb.make_basic_composition(measurements)[source]#

Construct the DP composition [measurement0, measurement1, …]. Returns a Measurement.

Parameters:

measurements (Any) – A list of measurements to compose.

Returns:

Measurement representing the composed transformations.

Return type:

Measurement

Raises:
  • AssertionError – if an argument’s type differs from the expected type

  • UnknownTypeError – if a type-argument fails to parse

  • OpenDPException – packaged error from the core OpenDP library

opendp.comb.make_chain_mt(measurement, transformation)[source]#

Construct the functional composition (measurementtransformation). Returns a Measurement.

Parameters:
Returns:

Measurement representing the chained computation.

Return type:

Measurement

Raises:
  • AssertionError – if an argument’s type differs from the expected type

  • UnknownTypeError – if a type-argument fails to parse

  • OpenDPException – packaged error from the core OpenDP library

opendp.comb.make_chain_tt(transformation1, transformation0)[source]#

Construct the functional composition (transformation1transformation0). Returns a Transformation.

Parameters:
Returns:

Transformation representing the chained computation.

Return type:

Transformation

Raises:
  • AssertionError – if an argument’s type differs from the expected type

  • UnknownTypeError – if a type-argument fails to parse

  • OpenDPException – packaged error from the core OpenDP library

opendp.comb.make_fix_delta(measurement, delta)[source]#

Fix the delta parameter in the privacy map of a measurement with a SmoothedMaxDivergence output measure.

Parameters:
  • measurement (Measurement) – The measurement with a privacy curve to be fixed.

  • delta (Any) – The parameter to fix the privacy curve with.

Returns:

New measurement with the same function, but a fixed output measure and privacy map.

Return type:

Measurement

Raises:
  • AssertionError – if an argument’s type differs from the expected type

  • UnknownTypeError – if a type-argument fails to parse

  • OpenDPException – packaged error from the core OpenDP library

opendp.comb.make_population_amplification(measurement, population_size)[source]#

Construct an amplified measurement from a measurement with privacy amplification by subsampling.

Parameters:
  • measurement (Measurement) – The measurement to amplify.

  • population_size (int) – Number of records in population.

Returns:

New measurement with the same function, but an adjusted privacy map.

Return type:

Measurement

Raises:
  • AssertionError – if an argument’s type differs from the expected type

  • UnknownTypeError – if a type-argument fails to parse

  • OpenDPException – packaged error from the core OpenDP library

opendp.comb.make_zCDP_to_approxDP(measurement)[source]#

Constructs a new output measure where output measure is casted from ZeroConcentratedDivergence to SmoothedMaxDivergence.

Parameters:

measurement (Measurement) – Measurement with ZeroConcentratedDivergence output measure.

Returns:

Measurement with SmoothedMaxDivergence output measure.

Return type:

Measurement

Raises:
  • AssertionError – if an argument’s type differs from the expected type

  • UnknownTypeError – if a type-argument fails to parse

  • OpenDPException – packaged error from the core OpenDP library