Documentation ¶
Index ¶
- Constants
- type Centroid
- type CentroidList
- type Error
- type TDigest
- func (t *TDigest) Add(x, w float64)
- func (t *TDigest) AddCentroid(c Centroid)
- func (t *TDigest) AddCentroidList(c CentroidList)
- func (t *TDigest) CDF(x float64) float64
- func (t *TDigest) Centroids() CentroidList
- func (t *TDigest) Count() float64
- func (t *TDigest) Quantile(q float64) float64
- func (t *TDigest) Reset()
Constants ¶
const ErrWeightLessThanZero = Error("centroid weight cannot be less than zero")
ErrWeightLessThanZero is used when the weight is not able to be processed.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Centroid ¶
Centroid average position of all points in a shape
type CentroidList ¶
type CentroidList []Centroid
CentroidList is sorted by the Mean of the centroid, ascending.
func NewCentroidList ¶
func NewCentroidList(centroids []Centroid) CentroidList
NewCentroidList creates a priority queue for the centroids
func (CentroidList) Len ¶
func (l CentroidList) Len() int
func (CentroidList) Less ¶
func (l CentroidList) Less(i, j int) bool
func (CentroidList) Swap ¶
func (l CentroidList) Swap(i, j int)
type TDigest ¶
type TDigest struct { Compression float64 // contains filtered or unexported fields }
TDigest is a data structure for accurate on-line accumulation of rank-based statistics such as quantiles and trimmed means.
func NewWithCompression ¶
NewWithCompression initializes a new distribution with custom compression.
func (*TDigest) AddCentroid ¶
AddCentroid adds a single centroid.
func (*TDigest) AddCentroidList ¶
func (t *TDigest) AddCentroidList(c CentroidList)
AddCentroidList can quickly add multiple centroids.
func (*TDigest) Centroids ¶
func (t *TDigest) Centroids() CentroidList
Centroids returns a copy of processed centroids. Useful when aggregating multiple t-digests.
Pass in the CentroidList as the buffer to write into.