Skip to content

Commit 0e6ad34

Browse files
Merge pull request OpenMined#455 from tak-ka3/fix/version.of.readme
update README about BoundedMean function
2 parents e4f1545 + ff00029 commit 0e6ad34

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

README.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,14 @@ import pydp as dp
6363
from pydp.algorithms.laplacian import BoundedMean
6464

6565
# Calculate the Bounded Mean
66-
# Structure: `BoundedMean(epsilon: double, lower: int, upper: int)`
66+
# Basic Structure: `BoundedMean(epsilon: float, lower_bound: Union[int, float, None], upper_bound: Union[int, float, None])`
6767
# `epsilon`: a Double, between 0 and 1, denoting the privacy threshold,
6868
# measures the acceptable loss of privacy (with 0 meaning no loss is acceptable)
69-
# `lower` and `upper`: Integers, representing lower and upper bounds, respectively
70-
x = BoundedMean(0.6, 1, 10)
69+
x = BoundedMean(epsilon=0.6, lower_bound=1, upper_bound=10)
7170

7271
# If the lower and upper bounds are not specified,
7372
# PyDP automatically calculates these bounds
74-
# x = BoundedMean(epsilon: double)
73+
# x = BoundedMean(epsilon: float)
7574
x = BoundedMean(0.6)
7675

7776
# Calculate the result

docs/readme.rst

+3-4
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,14 @@ Example: calculate the Bounded Mean
6161
from pydp.algorithms.laplacian import BoundedMean
6262
6363
# Calculate the Bounded Mean
64-
# Structure: `BoundedMean(epsilon: double, lower: int, upper: int)`
64+
# Basic Structure: `BoundedMean(epsilon: float, lower_bound: Union[int, float, None], upper_bound: Union[int, float, None])`
6565
# `epsilon`: a Double, between 0 and 1, denoting the privacy threshold,
6666
# measures the acceptable loss of privacy (with 0 meaning no loss is acceptable)
67-
# `lower` and `upper`: Integers, representing lower and upper bounds, respectively
68-
x = BoundedMean(0.6, 1, 10)
67+
x = BoundedMean(epsilon=0.6, lower_bound=1, upper_bound=10)
6968
7069
# If the lower and upper bounds are not specified,
7170
# PyDP automatically calculates these bounds
72-
# x = BoundedMean(epsilon: double)
71+
# x = BoundedMean(epsilon: float)
7372
x = BoundedMean(0.6)
7473
7574
# Calculate the result

0 commit comments

Comments
 (0)