Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type WeightedMinHasher ¶
type WeightedMinHasher struct { // Size of each hash element in bits. Supported values are 16, 32 and 64. Bitness int // contains filtered or unexported fields }
WeightedMinHasher calculates Weighted MinHash-es. https://ekzhu.github.io/datasketch/weightedminhash.html
func NewWeightedMinHasher ¶
func NewWeightedMinHasher(dim int, sampleSize int, seed int64) *WeightedMinHasher
NewWeightedMinHasher initializes a new instance of WeightedMinHasher. `dim` is the bag size. `sampleSize` is the hash length. `seed` is the random generator seed, as Weighted MinHash is probabilistic.
func (*WeightedMinHasher) Hash ¶
func (wmh *WeightedMinHasher) Hash(values []float32, indices []int) []uint64
Hash calculates the Weighted MinHash from the weighted bag of features. Each feature has an index and a value.
func (*WeightedMinHasher) MarshalBinary ¶
func (wmh *WeightedMinHasher) MarshalBinary() (data []byte, err error)
MarshalBinary serializes the WeightedMinHasher.
func (*WeightedMinHasher) UnmarshalBinary ¶
func (wmh *WeightedMinHasher) UnmarshalBinary(data []byte) error
UnmarshalBinary reads a WeightedMinHasher previously serialized with MarshalBinary().
Click to show internal directories.
Click to hide internal directories.