Documentation ¶
Overview ¶
Package minhash contains implementations of KMV and KHF MinHash algorithms
Index ¶
- type IntHeap
- type KHFsketch
- func (KHFsketch *KHFsketch) AddHash(hv uint64)
- func (KHFsketch *KHFsketch) GetAlgo() string
- func (KHFsketch *KHFsketch) GetMD5() string
- func (KHFsketch *KHFsketch) GetSimilarity(mh2 MinHash) (float64, error)
- func (KHFsketch *KHFsketch) GetSketch() []uint64
- func (KHFsketch *KHFsketch) Merge(KHFsketch2 *KHFsketch)
- func (KHFsketch *KHFsketch) SetMD5()
- type KMVsketch
- func (KMVsketch *KMVsketch) AddHash(hv uint64)
- func (KMVsketch *KMVsketch) GetAlgo() string
- func (KMVsketch *KMVsketch) GetMD5() string
- func (mh1 *KMVsketch) GetSimilarity(mh2 MinHash) (float64, error)
- func (KMVsketch *KMVsketch) GetSketch() []uint64
- func (KMVsketch *KMVsketch) SetMD5()
- func (KMVsketch *KMVsketch) SetSketch()
- type MinHash
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IntHeap ¶
type IntHeap []uint64
IntHeap is a min-heap of uint64s (we're satisfying the heap interface: https://golang.org/pkg/container/heap/)
func (IntHeap) Less ¶
the less method is returning the larger value, so that it is at index position 0 in the heap
func (*IntHeap) Pop ¶
func (IntHeap *IntHeap) Pop() interface{}
Pop is a method to remove an element from the heap
type KHFsketch ¶
type KHFsketch struct { KmerSize uint `json:"ksize"` Md5sum string `json:"md5sum"` Sketch []uint64 `json:"mins"` SketchSize uint `json:"num"` // contains filtered or unexported fields }
KHFsketch is the K-Hash Functions MinHash sketch of a set
func NewKHFsketch ¶
NewKHFsketch is the constructor for a KHFsketch
func (*KHFsketch) AddHash ¶
AddHash is a method to evaluate a hash value and add any minimums to the sketch
func (*KHFsketch) GetSimilarity ¶
GetSimilarity is a function to estimate the Jaccard similarity between sketches
func (*KHFsketch) GetSketch ¶
GetSketch is a method to return the sketch held by a MinHash KHF sketch object
type KMVsketch ¶
type KMVsketch struct { KmerSize uint `json:"ksize"` Md5sum string `json:"md5sum"` Sketch []uint64 `json:"mins"` SketchSize uint `json:"num"` // contains filtered or unexported fields }
KMVsketch is the bottom-k MinHash sketch of a set
func NewKMVsketch ¶
NewKMVsketch is the constructor for a KMVsketch
func (*KMVsketch) AddHash ¶
AddHash is a method to evaluate a hash value and add any minimums to the sketch
func (*KMVsketch) GetSimilarity ¶
Similarity computes a similarity estimate for two KMV sketches
func (*KMVsketch) GetSketch ¶
GetSketch is a method to set and return the sketch held by a MinHash KMV sketch