-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add PolyaEstimateNoiser #115
base: master
Are you sure you want to change the base?
Add PolyaEstimateNoiser #115
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very clear, thanks Pasin!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, but please update the comment copy-pasta as requested.
src/estimators/estimator_noisers.py
Outdated
"""A noiser that adds a difference of two Polya noises to a cardinality estimate.""" | ||
|
||
def __init__(self, r, p, random_state=None): | ||
"""Instantiates a GaussianEstimateNoiser object. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/Gaussian/Polya
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
src/estimators/estimator_noisers.py
Outdated
lambda x: x, r, p, random_state=random_state) | ||
|
||
def __call__(self, cardinality_estimate): | ||
"""Returns a cardinality estimate with Gaussian noise.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/Gaussian/Polya
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
Thanks for the catches Craig. Fixed now. |
Add PolyaMechanism and PolyaEstimateNoiser for adding a difference of two Polya noises to the input.
Note that, since we never use Polya alone (and hence there is no formal privacy proofs for the mechanism by itself), the initialization is done through the Polya parameters, rather than the privacy parameters.