tdebatty / java-LSH

A Java implementation of Locality Sensitive Hashing (LSH)
Other
295 stars 84 forks source link

Signature #4

Closed bertmsk closed 8 years ago

bertmsk commented 8 years ago

I'm not sure if this is an issue but how to combine signatures? Each new instance of LSHSuperBit produces different signatures for the same vector (well it should do because of random hyperplanes). It means we have different "bucket hits" and therefore random cosine similarity for the same vector instead of "1" How to use/compare it then? Save random hyperplanes and use it for all vectors in database or there's a way to make a "fingerprint"?

tdebatty commented 8 years ago

Hello,

Indeed, you can only compare signatures (or binning) computed by the same LSH instance. So you will have to serialize you LSH object. You can find an example here: https://github.com/tdebatty/java-LSH#serialization and there: https://github.com/tdebatty/java-LSH/blob/master/src/main/java/info/debatty/java/lsh/examples/SerializeExample.java

Don't hesitate to contact me if you have other issues...

Best regards,