OpenMined / PipelineDP

PipelineDP is a Python framework for applying differentially private aggregations to large datasets using batch processing systems such as Apache Spark, Apache Beam, and more.
https://pipelinedp.io/
Apache License 2.0
270 stars 75 forks source link

Mean mechanism implementation #445

Closed dvadym closed 1 year ago

dvadym commented 1 year ago

This PR implements MeanMechanism class (in dp_computations.py). This class is used for computing DP Mean in MeanCombiner. This is the part of the refactoring for making adding noise in more OOP style. This refactoring is needed for supporting PLD and l1 sensitivities in future.

Additional possibility which adds this refactoring it's possible to have more detailed description in explain computation reports about computin DP mean, here is an example:

_5. DP mean computation: a. Computed 'normalized_sum' = sum of (value - 3.0) b. Applied to 'count' Laplace mechanism: parameter=6.0 eps=0.3333333333333333 l1_sensitivity=2.0 c. Applied to 'normalized_sum' Laplace mechanism: parameter=12.0 eps=0.3333333333333333 l1sensitivity=4.0