Documentation
¶
Index ¶
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 ¶
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
func MakeBuilder ¶
MakeBuilder initializes a Builder; delta is the compression factor, which determines the size of the digest: the digest has at most 2*Delta centroids, with ~1.3*Delta in practice.
func (*Builder) Digest ¶
Digest returns the merged TDigest. The returned value is only valid until the next call to Add(), Merge(), or Reset().
type Centroid ¶
Centroid average position of all points in a shape
type Merger ¶
type Merger struct {
// contains filtered or unexported fields
}
func MakeMerger ¶
MakeMerger initializes a Merger; delta is the compression factor, which determines the size of the digest: the digest has at most 2*Delta centroids, with ~1.3*Delta in practice.
func (*Merger) Digest ¶
Digest returns the merged TDigest. The returned value is only valid until the next call to Merge() or Reset().
type TDigest ¶
type TDigest struct {
// contains filtered or unexported fields
}
TDigest is a t-digest, produced by a Builder or a Merger.
A TDigest is read-only (none of its methods modify it).
func (*TDigest) Quantile ¶
Quantile returns the (approximate) quantile of the distribution. Accepted values for q are between 0.0 and 1.0.