-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-5992][ML] Locality Sensitive Hashing #15148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 1 commit
Commits
Show all changes
46 commits
Select commit
Hold shift + click to select a range
1bbd48c
First Commit of LSH function implementation. Implement basic Estimato…
Yunni ca46d82
Implementation of Approximate Nearest Neighbors. Add distCol as anoth…
Yunni c693f5b
Implement approxSimilarityJoin(). Remove modelDataset and distCol as …
Yunni c9ee0f9
Add test utility method to check LSH property. Tested on random proje…
Yunni fc838e0
Add testing utility for approximate nearest neighbor. Run the testing…
Yunni aa138e8
Add testing utility for approximate similarity join. Run the testing …
Yunni bbcbcf0
Code review comments. A new unit test of k nearest neighbor for large k
d389159
Code review comments. A new unit test of k nearest neighbor for large k
19d012a
(1) Refactor hashDistCol for nearest neighbor search. (2) Add scalado…
269c8c9
Code Review comments: (1) Rewrite hashDistance (2) Move the lsh packa…
Yunni 9065f7d
Add comment to clarify the implementation of RandomProjection
Yunni d22dff4
Implementation of MinHash with unit tests
Yunni 7e6d938
Add options for Probing Single/Multiple bucket(s) in approxNearestNei…
Yunni 0fad3ef
Allow users to transform datasets themselves before doing approxNeare…
Yunni 0080b87
Generalize Input types to Vector. For MinHash, use Sparse Vectors to …
Yunni a1c344b
Code Review Comments
Yunni 396ad60
Bug fixed. Typo of distCol
Yunni b79ebbd
Fix Jenkins Build. Explicitly annotate type of modelDataset
Yunni 7936315
Move all code to org.apache.spark.ml.feature
Yunni f805658
Tune threshold for approxNearestNeighbors unit tests
Yunni 8f04ee8
Fix import ordering
Yunni f82f3fe
Add scaladoc for overloaded methods
Yunni ccd98f7
Code review comments
Yunni 69efc84
Move private[ml] to MinHash constructor
Yunni eced98d
Detailed doc on bucketLength. Move private[ml] to Model constructor
Yunni 3487bcc
Tune threshold for MinHash
df19886
Code review comments
efe323c
Code Review Comments
Yunni 142d8e9
Revert unrelated changes
Yunni 40d1f1b
Code review comments for MinHash: (1) Compute unionSize based on setS…
2c95e5c
Code review comments
Yunni fb120af
SignRandomProjection: LSH Classes for cosine distance metrics
19f6d89
Change hashFunctions to Arrays
1b63173
BitSampling: LSH Class for Hamming Distance
126d980
Merge remote-tracking branch 'upstream/master' into SPARK-5992-yunn-lsh
Yunni a35e261
Move distinct() before calculating the distance to improve running time
Yunni 66d553a
For similarity join, expose leftCol and rightCol as parameters
Yunni cad4ecb
Code Review comments: (1) Save BitSampling and SignRandomProjection f…
Yunni e14f73e
(1) Reset all random seed != 0 (2) Add docstring about the output sch…
Yunni 1c4b9fb
(1) Add readers/writers (2) Change unit tests thresholds to more rebo…
20a9ebf
Change a few Since annotations
9bb3fd6
Code Review Comments: (1) Remove all Since in LSH (2) Add doc on hash…
9a3704c
Organize the scaladoc
6cda936
Remove default values for outputCol
97e1238
Remove default values for outputCol
3570845
Add more scaladoc
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Code Review comments: (1) Rewrite hashDistance (2) Move the lsh packa…
…ge to be under feature
- Loading branch information
commit 269c8c91dfbc20d84a4e2e658a910b5adc68314c
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By default, this is computing the Manhattan distance between hash values, which probably works as a proxy for the distance between hash buckets when using LSH based on p-stable distributions and any other approach that produces vectors of integers/doubles as hash signatures (e.g. MinHash).
However, the default won't work for approaches that produce vectors of booleans as hash signatures (e.g. sign random projection for cosine distance). It could be overridden to compute Hamming distance in that case, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I am planning to override it for BitSampling (LSH for Hamming distance)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's algorithm-specific, I'd recommend making it abstract here so it's more future bug-proof.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.