Why it matters

Weighted sampling matches probability to importance. Foundational in ML and analytics.

Advertisement

The architecture

Key = U^(1/w) per item.

Keep top-k by key.

Uniform w.r.t. weights.

Weighted reservoir A-ResKeyU^(1/w) per itemTop-k by keymin-heapUniformweighted correctEfraimidis-Spirakis 2006; standard weighted single-pass sampling
Weighted reservoir A-Res.
Advertisement

How it works end to end

A-Res algorithm.

Min-heap of size k on keys.

Uniform under weights.