pub fn make_base_alp_with_hashers<K, C, T>(
    alpha: T,
    scale: T,
    s: usize,
    h: Vec<Rc<dyn Fn(&K) -> usize>>
) -> Fallible<Measurement<MapDomain<AtomDomain<K>, AtomDomain<C>>, AlpState<K, T>, L1Distance<C>, MaxDivergence<T>>>where
    K: 'static + Eq + Hash + CheckAtom,
    C: 'static + Clone + Integer + CheckAtom + DistanceConstant<C> + ToPrimitive,
    T: 'static + Float + DistanceConstant<T> + InfCast<Float> + InfCast<C>,
    Float: InfCast<T>,
    (MapDomain<AtomDomain<K>, AtomDomain<C>>, L1Distance<C>): MetricSpace,
Expand description

Measurement to compute a DP projection of bounded sparse data.

This function allows the user to create custom hash functions. The mechanism provides no utility guarantees if hash functions are chosen poorly. It is recommended to use make_base_alp.

Citations

Arguments

  • alpha - Parameter used for scaling and determining p in randomized response step. The default value is 4.
  • scale - Privacy loss parameter. This is equal to epsilon/sensitivity.
  • s - Size of the projection. This should be sufficiently large to limit hash collisions.
  • h - Hash functions used to project and estimate entries. The hash functions are not allowed to panic on any input. The hash functions in h should have type K -> [s]. To limit collisions the functions should be universal and uniform. The evaluation time of post-processing is O(h.len()).