Options
All
  • Public
  • Public/Protected
  • All
Menu

HyperLogLog is an algorithm for the count-distinct problem, approximating the number of distinct elements in a multiset.

see

HyperLogLog: the analysis of a near-optimal cardinality estimation algorithm http://algo.inria.fr/flajolet/Publications/FlFuGaMe07.pdf

author

Thomas Minier

Hierarchy

Index

Properties

_correctionBias: number

The bias-correction constant, denoted alpha in the algorithm

_hashing: Hashing
_nbBytesPerHash: number

Number of bytes to take per hash, denoted b in the algorithm (b = log2(m))

_nbRegisters: number

The number of registers, denoted m in the algorithm

_registers: number[]

The registers used to store data

_rng: prng
_seed: number

Methods

  • accuracy(): number
  • Compute the accuracy of the cardinality estimation produced by this HyperLogLog

    Returns number

    The accuracy of the cardinality estimation

  • count(round?: boolean): number
  • Estimate the cardinality of the multiset

    Parameters

    • round: boolean = false

    Returns number

    The estimated cardinality of the multiset

  • Check if another HyperLogLog is equal to this one

    Parameters

    • other: HyperLogLog

      The HyperLogLog to compare to this one

    Returns boolean

    True if they are equal, false otherwise

  • fromJSON(json: JSON): any
  • Load an Object from a provided JSON object

    Parameters

    • json: JSON

      the JSON object to load

    Returns any

    Return the Object loaded from the provided JSON object

  • nextInt32(): number
  • saveAsJSON(): any

Constructors

Accessors

  • get nbRegisters(): number
  • Get a function used to draw random number

    Returns prng

    A factory function used to draw random integer

  • get seed(): number
  • set seed(seed: number): void
  • Get the seed used in this structure

    Returns number

  • Set the seed for this structure

    Parameters

    • seed: number

      the new seed that will be used in this structure

    Returns void

Generated using TypeDoc