BoundedMean
computes the average of values in a dataset in a differentially private manner.
BoundedMean
supports int64
s and double
s as inputs. When successful, the returned Output
message will contain one element containing the differentially private mean. When bounds are inferred, the Output
additionally contains a BoundingReport
. The returned value is guaranteed to be <= the upper bound, and >= the lower bound.
BoundedMean
is a bounded algorithm. There are no additional parameters. Information on how to construct a BoundedMean
is found in the bounded algorithm documentation. Below is a minimal construction example.
absl::StatusOr<std::unique_ptr<BoundedMean<int64>>> bounded_mean = BoundedMean<int64>::Builder.SetEpsilon(1) .SetLower(-10) .SetUpper(10) .Build();
BoundedMean
is an Algorithm
and supports its full API.
For BoundedMean
, calling Result
is an O(n) operation.