Exemplo n.º 1
0
func (this *Stream) AddVectorOnlineStep(vec []float64) *itemset.Centroid {
	c := itemset.NewCentroidStream(vec)
	tmpvar := this.varianceTracker.UpdateVarianceSample(vec)

	if this.variance != tmpvar {
		for _, lsh := range this.lshGroup {
			lsh.UpdateDecoderVariance(tmpvar)
		}
		this.variance = tmpvar
	}

	for _, lsh := range this.lshGroup {
		hash := lsh.LSHHashStream(vec, this.rphashObject.GetNumberOfBlurs())

		for _, h := range hash {
			c.AddID(h)
		}
	}
	return c
}
Exemplo n.º 2
0
func NewCentroidStream(vec []float64) types.Centroid {
	return itemset.NewCentroidStream(vec)
}