Module org.elasticsearch.server
Class OnlineQuantileEstimator
java.lang.Object
org.elasticsearch.index.codec.vectors.cluster.OnlineQuantileEstimator
Computes an approximation of the q-quantile of a data stream using constant memory.
It uses this approach that was originally designed for integers.
This implementation works with floating-point numbers by quantizing the stream values. This requires knowing the minimum and maximum
values in the stream and choosing a desired precision.
Note that the precision only pertains to the quantization and the quantile estimator carries additional error.
-
Method Summary
Modifier and TypeMethodDescriptionfloatReturn the q-quantile estimate.voidupdateEstimate(float value) Update the estimate with a new value from the stream.voidupdateEstimate(float[] values) Update the estimate with a batch of values from the stream.
-
Method Details
-
updateEstimate
public void updateEstimate(float value) Update the estimate with a new value from the stream.- Parameters:
value- the new value from the stream
-
updateEstimate
public void updateEstimate(float[] values) Update the estimate with a batch of values from the stream.- Parameters:
values- the new values from the stream
-
getEstimate
public float getEstimate()Return the q-quantile estimate.
-