Skip to content
This repository was archived by the owner on Mar 13, 2023. It is now read-only.
This repository was archived by the owner on Mar 13, 2023. It is now read-only.

DP quantiles fail with a RuntimeError #70

@TedTed

Description

@TedTed

Hi folks,

I started from the basic data analysis notebook and wanted to try out quantile computation with the exponential mechanism.

I slightly modified the 10th code cell of the notebook to change:

sn.dp_mean(
    data = sn.to_float(data['age']),
    privacy_usage = {'epsilon': .65},
    data_lower = 0.,
    data_upper = 100.,
    data_rows = 1000
 )

to:

sn.dp_median(
    data = sn.to_float(data['age']),
    candidates = [float(i) for i in range(100)],
    mechanism = "Exponential",
    privacy_usage = {'epsilon': .65},
    data_lower = 0.,
    data_upper = 100.,
    data_rows = 1000
 )

Executing this cell raises the following error:

RuntimeError: Error: node specification ExponentialMechanism(ExponentialMechanism { privacy_usage: [PrivacyUsage { distance: Some(Approximate(DistanceApproximate { epsilon: 0.65, delta: 0.0 })) }] }):
Caused by: custom sensitivities may only be passed if protect_sensitivity is disabled

This probably shouldn't happen (presumably the quantile mechanism should figure out the sensitivity to pass to the exponential mechanism?), and the error message itself is wrong, since passing protect_sensitivity = False to sn.Analysis doesn't solve the issue, but raises a different message:

RuntimeError: Error: node specification ExponentialMechanism(ExponentialMechanism { privacy_usage: [PrivacyUsage { distance: Some(Approximate(DistanceApproximate { epsilon: 0.65, delta: 0.0 })) }] }):
Caused by: sensitivity has 1 records, while the expected shape has 100 records.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions