OpenMined / PyDP

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

FIX: Geometric distribution declaration & test #369

Closed grilhami closed 3 years ago

grilhami commented 3 years ago

Description

When running GaussianNB class in the PyDP_Naive_Bayes.ipynb file, the following error appears:

TypeError: __init__(): incompatible constructor arguments. The following argument types are supported:
    1. pydp.GeometricDistribution(lambda: float)
Invoked with: kwargs: lambda_=0.020202707317519466

This is because, the GeometricDistribution supposed to take in lambda, and not lambda_. However, the word lambda in Python refers to the lambda function; therefore, GeometricDistribution has been adjusted to accept lambda_ instead of lambda (see src/bindings/PyDP/algorithms/distributions.cpp). Test file has also been adjusted (see /tests/algorithms/test_distributions.py)

Affected Dependencies

GeometricDistribution has been adjusted to accept lambda_ instead of lambda.

How has this been tested?

Has been tested in the notebook PyDP_Naive_Bayes.ipynb

Checklist

review-notebook-app[bot] commented 3 years ago

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB