New Privacy on Beam codelab example/New Accounting Feature

Privacy on Beam:
- Add a public partitions example for count.
- Modify existing examples to use public partitions.

Accounting:
- Add functions to compute smallest noise for a given number of queries
  for Laplace, Discrete Laplace and Gaussian.

GitOrigin-RevId: 1db91c0f7cba7d5b71e5110a1e974f2c787bbc38
Change-Id: I8ef0d4ed1819f76f32466d33a2f11db79c0ee54c
11 files changed
tree: c98bd265ffa68bc98d037c90d09554039a259912
  1. cc/
  2. common_docs/
  3. docs/
  4. examples/
  5. experiments/
  6. go/
  7. java/
  8. privacy-on-beam/
  9. proto/
  10. python/
  11. BUILD
  12. CONTRIBUTING.md
  13. differential_privacy.md
  14. differential_privacy_deps.bzl
  15. LICENSE
  16. README.md
  17. WORKSPACE
README.md

Differential Privacy

This project contains a set of libraries of ε- and (ε, δ)-differentially private algorithms, which can be used to produce aggregate statistics over numeric data sets containing private or sensitive information. The functionality is currently available in C++, Go and Java.

Currently, we provide algorithms to compute the following:

AlgorithmC++GoJava
CountSupportedSupportedSupported
SumSupportedSupportedSupported
MeanSupportedSupportedSupported
VarianceSupportedPlannedPlanned
Standard deviationSupportedPlannedPlanned
Order statistics (incl. min, max, and median)SupportedPlannedPlanned
Automatic bounds approximationSupportedPlannedPlanned

We also provide an implementation of the Laplace and Gaussian mechanism that can be used to perform computations that aren't covered by our pre-built algorithms.

All of these algorithms are suitable for research, experimental or production use cases.

This project also contains:

How to Build

In order to run the differential private library, you need to install Bazel, if you don't have it already. Follow the instructions for your platform on the Bazel website

You also need to install Git, if you don't have it already. Follow the instructions for your platform on the Git website.

Once you've installed Bazel and Git, open a Terminal and clone the differential privacy directory into a local folder:

git clone https://github.com/google/differential-privacy.git

Navigate into the differential-privacy folder you just created, and build the differential privacy library and dependencies using Bazel (note: ... is a part of the command and not a placeholder):

To build the C++ library, run:

cd cc
bazel build ...

To build the Go library, run:

cd go
bazel build ...

To build the Java library, run:

cd java
bazel build ...

You may need to install additional dependencies when building the PostgreSQL extension, for example on Ubuntu you will need these packages:

sudo apt-get install make libreadline-dev bison flex

Caveats

Differential Privacy requires some bound on maximum number of contributions each user can make to a single partition. The libraries don't perform such bounding.

The libraries implementation assumes that each user contributes only a single row to each partition. It neither verifies nor enforces this; it is still the caller's responsibility to pre-process data to enforce this bound.

We chose not to implement this step at the library level because it‘s not the logical place for it - it’s much easier to sort contributions by user and combine them together with a distributed processing framework before they're passed to our algorithms. You can use the library to build systems that allow multiple contributions per user - our paper describes one such system. To do so, multiple user contributions should be combined before they are passed to our algorithms.

Support

We will continue to publish updates and improvements to the library. We are happy to accept contributions to this project. Please follow our guidelines when sending pull requests. We will respond to issues filed in this project. If we intend to stop publishing improvements and responding to issues we will publish notice here at least 3 months in advance.

License

Apache License 2.0

Support Disclaimer

This is not an officially supported Google product.

Reach out

We are always keen on hearing what use cases this library is helping you to solve. Please email us at dp-open-source@google.com about your use cases and what more we can do to help. Please refrain from sending us any personal identifiable information. If you wish to delete a message you've previously sent, please contact us.