OpenMined / PyDP

The Python Differential Privacy Library. Built on top of: https://github.com/google/differential-privacy
Apache License 2.0
503 stars 139 forks source link

BUG: AttributeError: 'BoundedSum' object has no attribute 'privacy_budget_left' #463

Closed idhamari closed 1 year ago

idhamari commented 1 year ago

From this example: https://github.com/chinmayshah99/pricon20/blob/master/Part_3.ipynb

    partial_dp_obj = BoundedSum(epsilon= 1, lower_bound =  5, upper_bound = 250, dtype ='float')
    partial_dp_obj.add_entries(new_df_1['sales_amount'].to_list()) # adding the first 3000 records   
    partial_dp_obj.privacy_budget_left() # 1.0

AttributeError: 'BoundedSum' object has no attribute 'privacy_budget_left'

idhamari commented 1 year ago

I have solved this by using:

budget_left = partial_dp_obj.__getattribute__("epsilon")
idhamari commented 1 year ago

However, I don't get the same result as the example! every time the value is 1.0

chinmayshah99 commented 1 year ago

Thank you for reporting this @idhamari! Let us look into why this is happening.

chinmayshah99 commented 1 year ago

Hi @idhamari, in the previous release of pydp, we had removed the support of function privacy_budget_left. More on it here: a88ee73053aa2bdc1be327a77109dd5907ab41d6