Count computes the number of values in a dataset in a differentially private manner.
Count supports any input type. Count always returns an Output message containing a single element with the differentially private count, and a ConfidenceInterval with the 95% confidence interval of noise added.
The differentially private count provided by the Output is an unbiased estimate of the raw count. Consequently, its value may sometimes be negative, in particular if the raw count is close to 0.
Count takes the usual parameters for Algorithm, with no additional parameters.
Count is an Algorithm and supports its full API. Below is a minimal construction example.
base::StatusOr<std::unique_ptr<Count<int64>>> count =
Count<int64>::Builder.SetEpsilon(1)
.Build();
For Count, calling Result is an O(n) operation. Count uses O(1) memory.