opendp.comb module#

opendp.comb.make_basic_composition(measurement0, measurement1)[source]#

Construct the DP composition (measurement0, measurement1). Returns a Measurement.

Parameters
  • measurement0 (Measurement) – The left member of the resulting 2-tuple.

  • measurement1 (Measurement) – The right member of the resulting 2-tuple.

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 Tranformation.

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_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 relation.

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