Пример #1
0
func NewCentroidStream(data []float64) *Centroid {
	return &Centroid{
		vec:   data,
		ids:   utils.NewHash64Set(),
		count: 1,
		id:    0,
	}
}
Пример #2
0
func NewCentroidSimple(dim int, id int64) *Centroid {
	data := make([]float64, dim)
	ids := utils.NewHash64Set()
	ids.Add(id)
	return &Centroid{
		vec:   data,
		ids:   ids,
		count: 0,
		id:    id,
	}
}