class QuantileSummaries extends Serializable

Helper class to compute approximate quantile summary. This implementation is based on the algorithm proposed in the paper: "Space-efficient Online Computation of Quantile Summaries" by Greenwald, Michael and Khanna, Sanjeev. (https://doi.org/10.1145/375663.375670)

In order to optimize for speed, it maintains an internal buffer of the last seen samples, and only inserts them after crossing a certain size threshold. This guarantees a near-constant runtime complexity compared to the original algorithm.

Linear Supertypes
Serializable, Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. QuantileSummaries
  2. Serializable
  3. Serializable
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new QuantileSummaries(compressThreshold: Int, relativeError: Double, sampled: Array[Stats] = Array.empty, count: Long = 0L, compressed: Boolean = false)

    compressThreshold

    the compression threshold. After the internal buffer of statistics crosses this size, it attempts to compress the statistics together.

    relativeError

    the target relative error. It is uniform across the complete range of values.

    sampled

    a buffer of quantile statistics. See the G-K article for more details.

    count

    the count of all the elements *inserted in the sampled buffer* (excluding the head buffer)

    compressed

    whether the statistics have been compressed

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  6. def compress(): QuantileSummaries

    Returns a new summary that compresses the summary statistics and the head buffer.

    Returns a new summary that compresses the summary statistics and the head buffer.

    This implements the COMPRESS function of the GK algorithm. It does not modify the object.

    returns

    a new summary object with compressed statistics

  7. val compressThreshold: Int
  8. var compressed: Boolean
  9. val count: Long
  10. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  11. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  12. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  13. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  14. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  15. def insert(x: Double): QuantileSummaries

    Returns a summary with the given observation inserted into the summary.

    Returns a summary with the given observation inserted into the summary. This method may either modify in place the current summary (and return the same summary, modified in place), or it may create a new summary from scratch it necessary.

    x

    the new observation to insert into the summary

  16. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  17. def merge(other: QuantileSummaries): QuantileSummaries

    Merges two (compressed) summaries together.

    Merges two (compressed) summaries together.

    Returns a new summary.

  18. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  19. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  20. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  21. def query(quantile: Double): Option[Double]

    Runs a query for a given quantile.

    Runs a query for a given quantile. The result follows the approximation guarantees detailed above. The query can only be run on a compressed summary: you need to call compress() before using it.

    quantile

    the target quantile

  22. val relativeError: Double
  23. val sampled: Array[Stats]
  24. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  25. def toString(): String
    Definition Classes
    AnyRef → Any
  26. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  27. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  28. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped