Github user jkbradley commented on the issue:
https://github.com/apache/spark/pull/15800
Limiting this discussion to MinHash:
Say we construct a hash table of L x K functions (for doing both OR and AND
amplification). For approxNearestNeighbors, we need to ask, "What is the best
scalar value we can compute from these L*K values to approximate the distance
between keys?"
* I think this is one point of confusion in previous discussion: I am
talking only about nearest neighbors, which sorts on a scalar estimate of
distance. Things are different when you want to build a data structure with
physical hash buckets.
Assume that our LxK functions are chosen independently at random (which is
what we are doing now).
Then I claim that, to compare distances between 2 points (1 query + 1 in
the dataset), there is no better way to combine these functions than to:
* Compute LxK binary 0/1 indicators of whether the 2 points match on each
hash function
* Average these LxK 0/1 indicators
Rough argument:
* For a given scalar hash function (without amplification), there is no
concept of "distance" between hash buckets. (This is different from P-Stable
LSH.)
* The distance metric we want to sort by is Jaccard similarity.
* The average of these indicators is an efficient estimator (in the
statistical sense) of the Jaccard similarity.
---
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]