public class AVLTreeDigest extends AbstractTDigest
Modifier and Type | Field and Description |
---|---|
static int |
SMALL_ENCODING |
static int |
VERBOSE_ENCODING |
gen, recordAllData
Constructor and Description |
---|
AVLTreeDigest(double compression)
A histogram structure that will record a sketch of a distribution.
|
Modifier and Type | Method and Description |
---|---|
void |
add(double x,
int w)
Adds a sample to a histogram.
|
void |
add(double x,
int w,
List<Double> data) |
void |
asBytes(ByteBuffer buf)
Outputs a histogram as bytes using a particularly cheesy encoding.
|
void |
asSmallBytes(ByteBuffer buf)
Serialize this TDigest into a byte buffer.
|
int |
byteSize()
Returns an upper bound on the number bytes that will be required to represent this histogram.
|
double |
cdf(double x)
Returns the fraction of all points added which are <= x.
|
int |
centroidCount()
The number of centroids currently in the TDigest.
|
Iterable<? extends Centroid> |
centroids()
An iterable that lets you go through the centroids in ascending order by mean.
|
void |
compress()
Re-examines a t-digest to determine whether some centroids are redundant.
|
void |
compress(GroupTree other) |
double |
compression()
Returns the current compression factor.
|
static AVLTreeDigest |
fromBytes(ByteBuffer buf)
Reads a histogram from a byte buffer
|
double |
quantile(double q)
Returns an estimate of the cutoff such that a specified fraction of the data
added to this TDigest would be less than or equal to the cutoff.
|
TDigest |
recordAllData()
Sets up so that all centroids will record all data assigned to them.
|
long |
size()
Returns the number of samples represented in this histogram.
|
int |
smallByteSize()
Returns an upper bound on the number of bytes that will be required to represent this histogram in
the tighter representation.
|
add, add, createCentroid, decode, encode, interpolate, isRecording, merge
checkValue, createArrayDigest, createArrayDigest, createTreeDigest
public static final int VERBOSE_ENCODING
public static final int SMALL_ENCODING
public AVLTreeDigest(double compression)
compression
- How should accuracy be traded for size? A value of N here will give quantile errors
almost always less than 3/N with considerably smaller errors expected for extreme
quantiles. Conversely, you should expect to track about 5 N centroids for this
accuracy.public TDigest recordAllData()
AbstractTDigest
recordAllData
in class AbstractTDigest
public void add(double x, int w)
TDigest
public void compress()
TDigest
public void compress(GroupTree other)
compress
in class AbstractTDigest
public long size()
public double cdf(double x)
TDigest
public double quantile(double q)
TDigest
public int centroidCount()
TDigest
centroidCount
in class TDigest
public Iterable<? extends Centroid> centroids()
TDigest
public double compression()
TDigest
compression
in class TDigest
public int byteSize()
public int smallByteSize()
smallByteSize
in class TDigest
public void asBytes(ByteBuffer buf)
public void asSmallBytes(ByteBuffer buf)
TDigest
asSmallBytes
in class TDigest
buf
- The byte buffer into which the TDigest should be serialized.public static AVLTreeDigest fromBytes(ByteBuffer buf)
Copyright © 2015. All rights reserved.