public abstract class TDigest extends Object implements Serializable
| Modifier and Type | Field and Description |
|---|---|
protected ScaleFunction |
scale |
| Constructor and Description |
|---|
TDigest() |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
add(double x)
Add a sample to this TDigest.
|
abstract void |
add(double x,
int w)
Adds a sample to a histogram.
|
abstract void |
add(List<? extends TDigest> others) |
abstract void |
add(TDigest other)
Add all of the centroids of another TDigest to this one.
|
abstract void |
asBytes(ByteBuffer buf)
Serialize this TDigest into a byte buffer.
|
abstract void |
asSmallBytes(ByteBuffer buf)
Serialize this TDigest into a byte buffer.
|
abstract int |
byteSize()
Returns the number of bytes required to encode this TDigest using #asBytes().
|
abstract double |
cdf(double x)
Returns the fraction of all points added which are ≤ x.
|
abstract int |
centroidCount() |
abstract Collection<Centroid> |
centroids()
A
Collection that lets you go through the centroids in ascending order by mean. |
abstract void |
compress()
Re-examines a t-digest to determine whether some centroids are redundant.
|
abstract double |
compression()
Returns the current compression factor.
|
static TDigest |
createAvlTreeDigest(double compression)
Creates an AVLTreeDigest.
|
static TDigest |
createDigest(double compression)
Creates a TDigest of whichever type is the currently recommended type.
|
static TDigest |
createMergingDigest(double compression)
Creates an
MergingDigest. |
double |
getMax() |
double |
getMin() |
abstract boolean |
isRecording() |
abstract double |
quantile(double q)
Returns an estimate of a cutoff such that a specified fraction of the data
added to this TDigest would be less than or equal to the cutoff.
|
abstract TDigest |
recordAllData()
Tell this TDigest to record the original data as much as possible for test
purposes.
|
void |
setScaleFunction(ScaleFunction scaleFunction) |
abstract long |
size()
Returns the number of points that have been added to this TDigest.
|
abstract int |
smallByteSize()
Returns the number of bytes required to encode this TDigest using #asSmallBytes().
|
protected ScaleFunction scale
public static TDigest createMergingDigest(double compression)
MergingDigest. This is generally the best known implementation right now.compression - The compression parameter. 100 is a common value for normal uses. 1000 is extremely large.
The number of centroids retained will be a smallish (usually less than 10) multiple of this number.public static TDigest createAvlTreeDigest(double compression)
compression - The compression parameter. 100 is a common value for normal uses. 1000 is extremely large.
The number of centroids retained will be a smallish (usually less than 10) multiple of this number.public static TDigest createDigest(double compression)
compression - The compression parameter. 100 is a common value for normal uses. 1000 is extremely large.
The number of centroids retained will be a smallish (usually less than 10) multiple of this number.public abstract void add(double x,
int w)
x - The value to add.w - The weight of this point.public abstract void compress()
public abstract long size()
public abstract double cdf(double x)
x - The cutoff for the cdf.public abstract double quantile(double q)
q - The desired fractionpublic abstract Collection<Centroid> centroids()
Collection that lets you go through the centroids in ascending order by mean. Centroids
returned will not be re-used, but may or may not share storage with this TDigest.public abstract double compression()
public abstract int byteSize()
public abstract int smallByteSize()
public void setScaleFunction(ScaleFunction scaleFunction)
public abstract void asBytes(ByteBuffer buf)
buf - The byte buffer into which the TDigest should be serialized.public abstract void asSmallBytes(ByteBuffer buf)
buf - The byte buffer into which the TDigest should be serialized.public abstract TDigest recordAllData()
public abstract boolean isRecording()
public abstract void add(double x)
x - The data value to addpublic abstract void add(TDigest other)
other - The other TDigestpublic abstract int centroidCount()
public double getMin()
public double getMax()
Copyright © 2021. All rights reserved.