Closed dvadym closed 1 year ago
This PR implements DP percentile computations.
API: It adds metric metrics.Percentile, so now it's possible to compute percentiles with DPEngine.aggregate
metrics.Percentile
DPEngine.aggregate
dp_engine.aggregate(... metrics=[metrics.Count, metrics.Percentile(50), metrics.Percentile(90)] ...)
The result looks like: (8, MetricsTuple(count=14532.95396910912, percentile_50=2.9999810443476416, percentile_90=4.99996013795033))
Implementation:
Metrics
enum
Metric
QuantileCombiner
QuantileTree
This PR implements DP percentile computations.
API: It adds metric
metrics.Percentile
, so now it's possible to compute percentiles withDPEngine.aggregate
dp_engine.aggregate(... metrics=[metrics.Count, metrics.Percentile(50), metrics.Percentile(90)] ...)
The result looks like: (8, MetricsTuple(count=14532.95396910912, percentile_50=2.9999810443476416, percentile_90=4.99996013795033))
Implementation:
Metrics
: previously it wasenum
, but metrics.Percentile(50) can't be implemented with enum, soMetric
class was implemented.QuantileCombiner
is implemented. It usesQuantileTree
object which is wrapper from PyDP for the object from Google C++ building block library