topkapi

package module
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 19, 2021 License: MIT Imports: 4 Imported by: 0

README

topkapi

Topkapi: Parallel and Fast Sketches for Finding Top-K Frequent Elements

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LocalHeavyHitter

type LocalHeavyHitter struct {
	Key   interface{}
	Count uint64
}

type Sketch

type Sketch struct {
	// contains filtered or unexported fields
}

func New

func New(delta, epsilon float64) (*Sketch, error)

New creates a new Topkapi Sketch with given error rate and confidence. Accuracy guarantees will be made in terms of a pair of user specified parameters, ε and δ, meaning that the error in answering a query is within a factor of ε with probability 1-δ

func NewTopK

func NewTopK(k, approxCorpusSize uint64, delta float64) (*Sketch, error)

NewTopK creates a sketch suitable for finding TopK in a corpus of a given size, with an error rate of delta.

func (*Sketch) Delta

func (sk *Sketch) Delta() float64

Delta is the probability for a measurement to be outside the epsilon range

func (*Sketch) Epsilon

func (sk *Sketch) Epsilon() float64

Epsilon is the approximate error range factor.

func (*Sketch) Insert

func (sk *Sketch) Insert(key interface{}, count uint64)

Insert ...

func (*Sketch) Merge

func (sk *Sketch) Merge(other *Sketch) error

Merge ...

func (*Sketch) Result

func (sk *Sketch) Result(threshold uint64) []LocalHeavyHitter

Result ...

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL