Options
All
  • Public
  • Public/Protected
  • All
Menu

The count–min sketch (CM sketch) is a probabilistic data structure that serves as a frequency table of events in a stream of data. It uses hash functions to map events to frequencies, but unlike a hash table uses only sub-linear space, at the expense of overcounting some events due to collisions.

Reference: Cormode, G., & Muthukrishnan, S. (2005). An improved data stream summary: the count-min sketch and its applications. Journal of Algorithms, 55(1), 58-75.

see

http://vaffanculo.twiki.di.uniroma1.it/pub/Ing_algo/WebHome/p14_Cormode_JAl_05.pdf for more details on Count Min Sketch

author

Thomas Minier & Arnaud Grall

Hierarchy

Implements

Index

Properties

_allSums: number
_columns: number
_hashing: Hashing
_matrix: number[][]
_rng: PRNG
_rows: number
_seed: number

Methods

  • Create a count-min sketch, with a target error rate and probability of accuracy

    Parameters

    • errorRate: number

      The error rate

    • accuracy: number = 0.999

      The probability of accuracy

    Returns CountMinSketch

    A new Count Min Sketch optimal for the input parameters

  • Create a Count Min Sketch from a set of items, with a target error rate and probability of accuracy

    Parameters

    • items: Iterable<<internal>.HashableInput>

      An iterable to yield items to be inserted into the filter

    • errorRate: number

      The error rate

    • accuracy: number = 0.999

      The probability of accuracy

    Returns CountMinSketch

    A new Count Min Sketch filled with the iterable's items.

  • 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

Accessors

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

    Returns PRNG

    A factory function used to draw random integer

  • get rows(): number
  • 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

  • get sum(): number

Constructors

Generated using TypeDoc