Module Hub Beta
Track the top-k most frequent elements in a stream
Track the top-k most frequent elements in a stream using Redis.
The basic algorithm is described at (the 1st one): https://www.cs.berkeley.edu/~satishr/cs270/sp11/rough-notes/Streaming-two.pdf
When a TopK key reaches cardinality of
k and a new element needs to be added, the following eviction policy it practiced:
- The frequencies of all existing observations are decreased by 1.
- If there is an observation that can be evicted, it is replaced by the element.