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:
- 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 (measurement ○ transformation). Returns a Measurement.
- Parameters:
measurement (Measurement) – outer privatizer
transformation (Transformation) – inner query
- Returns:
Measurement representing the chained computation.
- Return type:
- 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 (transformation1 ○ transformation0). Returns a Tranformation.
- Parameters:
transformation1 (Transformation) – outer transformation
transformation0 (Transformation) – inner transformation
- Returns:
Transformation representing the chained computation.
- Return type:
- 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:
- 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