Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var NewMinhashLSH = NewMinhashLSH32
NewMinhashLSH is the default constructor uses 32 bit hash value with pre-allocation of hash tables.
Functions ¶
This section is empty.
Types ¶
type Minhash ¶
type Minhash struct {
// contains filtered or unexported fields
}
Minhash represents a MinHash object
func NewMinhash ¶
NewMinhash initialize a MinHash object with a seed and the number of hash functions.
func (*Minhash) Merge ¶
Merge combines the signature of the other Minhash with this one, making this one carry the signature of the union.
type MinhashLSH ¶
type MinhashLSH struct { K int L int HashTables []hashTable HashKeyFunc hashKeyFunc HashValueSize int NumIndexedKeys int }
MinhashLSH represents a MinHash LSH implemented using LSH Forest (http://ilpubs.stanford.edu:8090/678/1/2005-14.pdf). It supports query-time setting of the MinHash LSH parameters L (number of bands) and K (number of hash functions per band).
func NewMinhashLSH16 ¶
func NewMinhashLSH16(numHash int, threshold float64, initSize int) *MinhashLSH
NewMinhashLSH16 uses 16-bit hash values and pre-allocation of hash tables. MinHash signatures with 64 or 32 bit hash values will have their hash values trimed.
func NewMinhashLSH32 ¶
func NewMinhashLSH32(numHash int, threshold float64, initSize int) *MinhashLSH
NewMinhashLSH32 uses 32-bit hash values and pre-allocation of hash tables. MinHash signatures with 64 bit hash values will have their hash values trimed.
func NewMinhashLSH64 ¶
func NewMinhashLSH64(numHash int, threshold float64, initSize int) *MinhashLSH
NewMinhashLSH64 uses 64-bit hash values and pre-allocation of hash tables.
func (*MinhashLSH) Add ¶
func (f *MinhashLSH) Add(key interface{}, sig []uint64)
Add a Key with MinHash signature into the index. The Key won't be searchable until Index() is called.
func (*MinhashLSH) Params ¶
func (f *MinhashLSH) Params() (k, l int)
Params returns the LSH parameters K and L
func (*MinhashLSH) Query ¶
func (f *MinhashLSH) Query(sig []uint64) []interface{}
Query returns candidate keys given the query signature.
func (*MinhashLSH) Save ¶
func (minhashLsh *MinhashLSH) Save(filename string) error
Save MinHash LSH index