zhengruifeng commented on a change in pull request #31394:
URL: https://github.com/apache/spark/pull/31394#discussion_r568419326



##########
File path: 
mllib/src/main/scala/org/apache/spark/ml/feature/BucketedRandomProjectionLSH.scala
##########
@@ -97,7 +97,19 @@ class BucketedRandomProjectionLSHModel private[ml](
   @Since("2.1.0")
   override protected[ml] def hashDistance(x: Seq[Vector], y: Seq[Vector]): 
Double = {
     // Since it's generated by hashing, it will be a pair of dense vectors.
-    x.zip(y).map(vectorPair => Vectors.sqdist(vectorPair._1, 
vectorPair._2)).min
+    // Currently each hash vector (generated by hashFunction) only has one 
element, this equals to:

Review comment:
       It is possible that a hash vector has length>1, but in current impl 
(since 2.1), each vector has only one value.




----------------------------------------------------------------
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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to