predict.bernstein {diffpriv} | R Documentation |
Evaluate Bernstein approximations on data.
Description
Evaluates a given S3 object of type bernstein
on given
data D
.
Usage
## S3 method for class 'bernstein'
predict(object, D, ...)
Arguments
object |
an S3 object of type |
D |
either a numeric vector or matrix, all values in |
... |
additional arguments. |
Value
a numeric vector of scalar real evaluations.
References
Francesco Aldà and Benjamin I. P. Rubinstein. "The Bernstein Mechanism: Function Release under Differential Privacy", in Proceedings of the 31st AAAI Conference on Artificial Intelligence (AAAI'2017), pp. 1705-1711, Feb 2017.
Examples
f <- function(x) x * sin(x*10)
b <- bernstein(f, dims = 1)
xs <- seq(from=0, to=1, length=50)
mean((f(xs) - predict(b,xs))^2)
[Package diffpriv version 0.4.2 Index]