You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/12/23 04:36:49 UTC

[GitHub] [spark] zhengruifeng edited a comment on issue #26948: [SPARK-30120][ML] LSH approxNearestNeighbors should use BoundedPriorityQueue when numNearestNeighbors is small

zhengruifeng edited a comment on issue #26948: [SPARK-30120][ML] LSH approxNearestNeighbors should use BoundedPriorityQueue when numNearestNeighbors is small
URL: https://github.com/apache/spark/pull/26948#issuecomment-568335734
 
 
   @srowen @huaxingao 
   I rethinked this more, and I found another solution:
   1, current impl need a threshold, we no longer need `BoundedPriorityQueue`. Current impl compute count and quantile on two pass, we can just compute them together on only one pass. So the advantage that `BoundedPriorityQueue` do not need an extra pass does not exist, `approxQuantile` is enough, but we need to use `QuantileSummaries` directly;
   2, still for top-K when nn is small (maybe < 1000 at first?). Why not using `BoundedPriorityQueue` to directly collect the top-K **rows (now distCol for a threshold)**? 
   3, for the final `modelSubsetWithDistCol.sort(distCol).limit(numNearestNeighbors)`. when nn is small, using `BoundedPriorityQueue` to avoid global sort.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org