7/13
Part 5 of 7 · At scaleLearn and do

When exact costs too much, merge sketches

Count maps break down with a billion distinct products. A heavy hitters summary keeps only k counters. In the Misra-Gries version, a new item takes a free counter. When none is free, every counter drops by one, and the new item isn't stored: it spends itself cancelling one count from each. Two of these summaries merge by adding up the corresponding counters, then trimming back to k. Apache DataSketches' frequent items sketch returns, for any item, upper and lower bounds that always contain its true count, and BigQuery's APPROX_TOP_COUNT returns the approximate top elements.

Predict

A Misra-Gries summary keeps 2 counters over 14 orders. Which products are sure to survive?

Pick an answer above to see the rest