Count-min Sketch implementation for Julia
Switch branches/tags
Clone or download
Pull request Compare This branch is 1 commit ahead, 17 commits behind kdmurray91:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github
doc
misc
src
test
.gitignore
.travis.yml
CODE_OF_CONDUCT.md
CONTRIBUTING.md
LICENSE.md
Makefile
README.md
REQUIRE

README.md

CountMin.jl

Build Status

A count-min-sketch implementation for Julia. See Wikipedia or the original paper for more information on the background of this data structure.

API

Real documentation is on its way. In the mean time, read the tests as they have a fairly full description of the API.

The API tries to follow the Julia standard method names.

# make a CMS with 4 tables of ~1000 cells
# Each cell will be a UInt8, so can count to 255. You can use any unsigned
# integral type as the cell type.
cms = CountMinSketch{UInt8}(4, 1000)

# add the string "Hello"
push!(cms, "Hello")
assert(cms["Hello"] == 1)

# Add 3 counts of the string "World"
add!(cms, "World", 3)
assert(cms["World"] == 3)

# Remove the count of "Hello"
pop!(cms, "Hello")
assert(cms["Hello"] == 0)

# Remove two counts of "World"
add!(cms, "World", -2)
assert(cms["World"] == 1)