Skip to main content
QUICK REVIEW

[Paper Review] Stream Sampling for Frequency Cap Statistics

Edith Cohen|arXiv (Cornell University)|Feb 20, 2015
Advanced Database Systems and Queries23 references4 citations
TL;DR

This paper proposes a stream sampling framework for estimating frequency cap statistics—such as distinct counts and sum—over unaggregated data using a single or two passes with state proportional to the desired sample size. It introduces ℓ-capped samples that provide nearly optimal, unbiased estimates for monotone frequency statistics, unifying classic approaches for distinct and sum while enabling multi-objective sampling with tight error bounds.

ABSTRACT

Unaggregated data, in streamed or distributed form, is prevalent and come from diverse application domains which include interactions of users with web services and IP traffic. Data elements have {\em keys} (cookies, users, queries) and elements with different keys interleave. Analytics on such data typically utilizes statistics stated in terms of the frequencies of keys. The two most common statistics are {\em distinct}, which is the number of active keys in a specified segment, and {\em sum}, which is the sum of the frequencies of keys in the segment. Both are special cases of {\em cap} statistics, defined as the sum of frequencies {\em capped} by a parameter $T$, which are popular in online advertising platforms. Aggregation by key, however, is costly, requiring state proportional to the number of distinct keys, and therefore we are interested in estimating these statistics or more generally, sampling the data, without aggregation. We present a sampling framework for unaggregated data that uses a single pass (for streams) or two passes (for distributed data) and state proportional to the desired sample size. Our design provides the first effective solution for general frequency cap statistics. Our $\ell$-capped samples provide estimates with tight statistical guarantees for cap statistics with $T=Θ(\ell)$ and nonnegative unbiased estimates of {\em any} monotone non-decreasing frequency statistics. An added benefit of our unified design is facilitating {\em multi-objective samples}, which provide estimates with statistical guarantees for a specified set of different statistics, using a single, smaller sample.

Motivation & Objective

  • To address the challenge of efficiently estimating frequency cap statistics over unaggregated, high-cardinality data streams with limited memory.
  • To design a sampling method that approximates the gold-standard weighted sample without requiring full aggregation of key frequencies.
  • To unify existing solutions for distinct counts and sum queries under a single principled framework.
  • To enable multi-objective sampling that provides tight estimates for multiple statistics using a single compact sample.
  • To minimize estimation error while maintaining space efficiency, especially for mid-range cap parameters common in online advertising.

Proposed method

  • The framework uses ℓ-capped samples, where each key is included with probability proportional to f(w), with f being a monotone non-decreasing function such as cap_T(w) = min(w, T).
  • It processes data in one pass (streaming) or two passes (distributed), maintaining a state size proportional only to the desired sample size k.
  • The method supports both with-replacement and without-replacement sampling, enabling unbiased estimation of frequency cap statistics.
  • It leverages a novel sampling probability assignment that adapts to the frequency distribution, ensuring near-optimal variance for mid-range caps.
  • The design allows for multi-objective sampling by jointly optimizing sampling probabilities across multiple target statistics using a single sample.
  • It provides theoretical error bounds on coefficient of variation (CV) that closely match those of an ideal weighted sample over the aggregated data.

Experimental results

Research questions

  • RQ1Can we estimate frequency cap statistics accurately over unaggregated data streams without full aggregation?
  • RQ2How can we design a sampling framework that unifies distinct count and sum estimation under a single efficient mechanism?
  • RQ3What is the achievable accuracy of a sample computed without aggregation, relative to an optimal weighted sample over the aggregated data?
  • RQ4How does the framework perform across different cap parameters T and frequency distributions?
  • RQ5Can a single sample support tight estimates for multiple statistics simultaneously?

Key findings

  • The ℓ-capped sampling framework achieves nearly optimal estimation error for frequency cap statistics, with CV bounds close to those of a gold-standard sample over the aggregated data.
  • For mid-range caps (T = Θ(ℓ)), the method provides estimates that are close to the theoretical optimum, significantly outperforming single-objective samples.
  • The error for estimating distinct counts (T=1) using ℓ=1 is within a factor of 3 of the optimal, and for sum (T=∞) using ℓ=∞, the error is within a factor of 30 in the worst case.
  • The benefit of a second pass in distributed settings is limited—typically less than 10% improvement in error—confirming the robustness of the streaming variant.
  • Simulations show that the actual error for higher cap values is often much lower than theoretical CV upper bounds, suggesting potential for adaptive confidence bounds.
  • The framework enables multi-objective sampling with a single sample that provides tight estimates across multiple statistics, reducing the need for multiple large samples.

Better researchstarts right now

From reading papers to final review, dramatically reduce your research time.

No credit card · Free plan available

This review was created by AI and reviewed by human editors.