Documentation
¶
Overview ¶
Package codelab contains example pipelines for computing various aggregations using Privacy on Beam.
Index ¶
- func ComputeCountMeanSum(s beam.Scope, col beam.PCollection) (visitsPerHour, meanTimeSpent, revenues beam.PCollection)
- func CountVisitsPerHour(s beam.Scope, col beam.PCollection) beam.PCollection
- func CreateVisitsFn(line string, emit func(Visit)) error
- func MeanTimeSpent(s beam.Scope, col beam.PCollection) beam.PCollection
- func PrivateCountVisitsPerHour(s beam.Scope, col beam.PCollection) beam.PCollection
- func PrivateCountVisitsPerHourWithPublicPartitions(s beam.Scope, col beam.PCollection) beam.PCollection
- func PrivateMeanTimeSpent(s beam.Scope, col beam.PCollection) beam.PCollection
- func PrivateRevenuePerHour(s beam.Scope, col beam.PCollection) beam.PCollection
- func RevenuePerHour(s beam.Scope, col beam.PCollection) beam.PCollection
- type Visit
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComputeCountMeanSum ¶
func ComputeCountMeanSum(s beam.Scope, col beam.PCollection) (visitsPerHour, meanTimeSpent, revenues beam.PCollection)
ComputeCountMeanSum computes the three aggregations (count, mean and sum) we compute separately in the other files in a differentially private way. This pipeline uses a single PrivacySpec for all the aggregations, meaning that they share the same privacy budget.
func CountVisitsPerHour ¶
func CountVisitsPerHour(s beam.Scope, col beam.PCollection) beam.PCollection
CountVisitsPerHour counts and returns the number of visits to a restaurant for each hour. This produces a non-anonymized, non-private count. Use PrivateCountVisitsPerHour for computing this in an anonymized way.
func CreateVisitsFn ¶
CreateVisitsFn creates and emits a Visit struct from a line that holds visit information.
func MeanTimeSpent ¶
func MeanTimeSpent(s beam.Scope, col beam.PCollection) beam.PCollection
MeanTimeSpent calculates and returns the average time spent by visitors who entered the restaurant for each hour. This produces a non-anonymized, non-private count. Use PrivateMeanTimeSpent for computing this in an anonymized way.
func PrivateCountVisitsPerHour ¶
func PrivateCountVisitsPerHour(s beam.Scope, col beam.PCollection) beam.PCollection
PrivateCountVisitsPerHour counts and returns the number of visits to a restaurant for each hour in a differentially private way.
func PrivateCountVisitsPerHourWithPublicPartitions ¶
func PrivateCountVisitsPerHourWithPublicPartitions(s beam.Scope, col beam.PCollection) beam.PCollection
PrivateCountVisitsPerHourWithPublicPartitions counts and returns the number of visits to a restaurant for each hour in a differentially private way. It uses the "public partitions" feature to disable partition selection/thresholding.
func PrivateMeanTimeSpent ¶
func PrivateMeanTimeSpent(s beam.Scope, col beam.PCollection) beam.PCollection
PrivateMeanTimeSpent calculates and returns the average time spent by visitors who entered the restaurant for each hour in a differentially private way.
func PrivateRevenuePerHour ¶
func PrivateRevenuePerHour(s beam.Scope, col beam.PCollection) beam.PCollection
PrivateRevenuePerHour calculates and returns the total money spent by visitors who entered the restaurant for each hour in a differentially private way.
func RevenuePerHour ¶
func RevenuePerHour(s beam.Scope, col beam.PCollection) beam.PCollection
RevenuePerHour calculates and returns the total money spent by visitors who entered the restaurant for each hour. This DOES NOT produce an anonymized output. Use PrivateRevenuePerHour for computing this in an anonymized way.