Class OnlineQuantileEstimator

java.lang.Object
org.elasticsearch.index.codec.vectors.cluster.OnlineQuantileEstimator

public class OnlineQuantileEstimator extends Object
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 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.