privpack.utils.metrics module

Some introduction on how to use the metrics

API Documentation

Statistic classes are used to compute full data-set metrics. This module supports the following metric classes:

  • PartialBivariateBinaryMutualInformation

  • PartialMultivariateGaussianMutualInformation

  • ComputeDistortion

How to use this module

(See the individual classes, methods and attributes for more details)

  1. Import …. TODO

  2. Define a instance …. TODO

class privpack.utils.metrics.BivariateBinaryMutualInformation(name: str)

Bases: privpack.utils.metrics.Metric

compute_mutual_information(dist: torch.Tensor) → float
estimate_binary_distribution(data: torch.Tensor) → torch.Tensor
mi(released_data: torch.Tensor, data: torch.Tensor) → float
class privpack.utils.metrics.ComputeDistortion(name: str, dimensions: List[int])

Bases: privpack.utils.metrics.Metric

compute_distortion(released_data: torch.Tensor, data: torch.Tensor) → float
set_distortion_function(distortion_func: Callable[[torch.Tensor, torch.Tensor], torch.Tensor])
class privpack.utils.metrics.Metric(name: str)

Bases: abc.ABC

Base class for creating full data-set Metric.

class privpack.utils.metrics.MultivariateGaussianMutualInformation(name: str)

Bases: privpack.utils.metrics.Metric

compute_mutual_information(full_cov_table, released_data_size) → float
mi(released_data: torch.Tensor, data: torch.Tensor) → float

Collect the results of the helper functions, and return the mutual information.

class privpack.utils.metrics.PartialBivariateBinaryMutualInformation(name: str, dimension: int)

Bases: privpack.utils.metrics.BivariateBinaryMutualInformation

class privpack.utils.metrics.PartialMultivariateGaussianMutualInformation(name: str, dimensions: List[int])

Bases: privpack.utils.metrics.MultivariateGaussianMutualInformation