Github user viirya commented on a diff in the pull request:
https://github.com/apache/spark/pull/15800#discussion_r87528327
--- Diff: mllib/src/main/scala/org/apache/spark/ml/feature/MinHash.scala ---
@@ -76,7 +72,19 @@ class MinHashModel private[ml] (
@Since("2.1.0")
override protected[ml] def hashDistance(x: Vector, y: Vector): Double = {
// Since it's generated by hashing, it will be a pair of dense vectors.
- x.toDense.values.zip(y.toDense.values).map(pair => math.abs(pair._1 -
pair._2)).min
+ if (x.toDense.values.zip(y.toDense.values).exists(pair => pair._1 ==
pair._2)) {
--- End diff --
I think I do more agree on the comment from @jkbradley at
https://github.com/apache/spark/pull/15800#issuecomment-259298082, if I
understand correctly some terms here.
Is the indicator meaning a matching hashing value between two vectors from
one hashing function, i.e., h_i?
If this understanding is correct, I think averaging indicators should be
the right way to compute MinHash's hash distance.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]