Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git src/main/scala/io/radanalytics/equoid/topk.scala src/main/scala/io/radanalytics/equoid/topk.scala
- index 25801e7..639071e 100644
- --- src/main/scala/io/radanalytics/equoid/topk.scala
- +++ src/main/scala/io/radanalytics/equoid/topk.scala
- @@ -23,10 +23,13 @@ class TopK[V] (
- val ucms: CountMinSketch = ecms.mergeInPlace(this.cms)
- ucms.add(v, 1)
- val vf = ucms.estimateCount(v).toInt
- - val (utopk, ufmin) = if (topk.size < k) {
- - (topk + (v -> vf), math.min(vf, fmin))
- + val (utopk, ufmin) = if (topk.size < k || topk.contains(v)) {
- + (topk + (v -> vf), vf)
- } else if (vf <= fmin) (topk, fmin) else {
- val del = topk.minBy { case (_, f) => f }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement