privacy_budget#

Classes for specifying privacy budgets.

For a full introduction to privacy budgets, see the privacy budget topic guide.

Classes#

PrivacyBudget

Base class for specifying privacy parameters.

PureDPBudget

A privacy budget under pure differential privacy.

RhoZCDPBudget

A privacy budget under rho-zero-concentrated differential privacy.

class PrivacyBudget#

Bases: abc.ABC

Base class for specifying privacy parameters.

A PrivacyBudget is a privacy definition, along with its associated parameters. The choice of a PrivacyBudget has an impact on the accuracy of query results. Smaller parameters correspond to a stronger privacy guarantee, and usually lead to less accurate results.

Note

An “infinite” privacy budget means that the chosen DP algorithm will use parameters that do not guarantee privacy. This is not always exactly equivalent to evaluating the query without applying differential privacy. Please see the individual subclasses of PrivacyBudget for details on how to appropriately specify infinite budgets.

class PureDPBudget(epsilon)#

Bases: PrivacyBudget

A privacy budget under pure differential privacy.

This privacy definition is also known as epsilon-differential privacy, and the associated value is the epsilon privacy parameter. The privacy definition can be found here

Parameters

epsilon (Union[int, float]) –

__init__(epsilon)#

Construct a new PureDPBudget.

Parameters

epsilon (int | floatUnion[int, float]) – The epsilon privacy parameter. Must be non-negative and cannot be NaN. To specify an infinite budget, set epsilon equal to float(‘inf’).

property epsilon(self)#

Returns the value of epsilon.

Return type

Union[int, float]

__eq__(self, other)#

Returns whether or not two PureDPBudgets are equivalent.

Return type

bool

class RhoZCDPBudget(rho)#

Bases: PrivacyBudget

A privacy budget under rho-zero-concentrated differential privacy.

The definition of rho-zCDP can be found in this paper under Definition 1.1.

Parameters

rho (Union[int, float]) –

__init__(rho)#

Construct a new RhoZCDPBudget.

Parameters

rho (int | floatUnion[int, float]) – The rho privacy parameter. Rho must be non-negative and cannot be NaN. To specify an infinite budget, set rho equal to float(‘inf’).

property rho(self)#

Returns the value of rho.

Return type

Union[int, float]

__eq__(self, other)#

Returns whether or not two RhoZCDPBudgets are equivalent.

Return type

bool