A Library with Fast Sketching Primitives
Project description
Fast Sketches
While implementing a paper, we had to create a new library for Count-Min Sketches and Count-Sketches, as current solutions were inadequate. C++ libraries are difficult to use, and Python packages tend to be slow. Thus, we wrote a Python package that contains Python bindings to a C++ library to calculate the predictions of the count-min sketch and count-sketches. This code is located in fast_sketches.cpp
.
We include a Python Package that contains Python bindings to a C++ library to calculate the results of the count-min sketch and count-sketches.
NOTE: this only works on Mac in our current version.
First, you will need pybind11, so run
pip install pybind11
Then, run
sh build.sh
to install the sketches library. This library implements two functions:
[numpy array of long longs] cm_sketch_preds(int nhashes, [numpy array of long longs] np_input, ll width, int seed)
takes as input a random seed, the number of hashes, the width of the sketch (or the number of cells in each row), and the frequencies of each key. Then, it outputs what a count-min sketch would give as predicted frequencies with that particular set of parameters.
For example,
[numpy array of long longs] count_sketch_preds(int nhashes, [numpy array of long longs] np_input, ll width, int seed)
performs the same function for the Count-Sketch.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for quick_sketches-0.0.1-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 97ec64535efbc898583c9d640a07daf5556fa296e74728417cb624f68d428c14 |
|
MD5 | a1d8a9c0feb187dbd4e02841d84e63b1 |
|
BLAKE2b-256 | 30e7bed411d9d010fcc2a2a0b411ebcad3fff86fdafc8abd2d0a41ba2caee99c |
Hashes for quick_sketches-0.0.1-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a80931c0afc460b00003296b643b243ce73db86a2a5ae56b98e316712a3dfc7b |
|
MD5 | 17169046d1ee349e87eade0a61e47e88 |
|
BLAKE2b-256 | 25ca1859af7b92e8969145d7364758e0954fd3f2ae1ad7019a60a09f1eb1624d |
Hashes for quick_sketches-0.0.1-cp38-cp38-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b45180987e7098cf61b801359e52966c31a46c2f98aae1ddd3c4adac9cd186b |
|
MD5 | 26879dfc9522083d81ade1ee74348076 |
|
BLAKE2b-256 | 65a3db4948ed5456069dd9914ec539aa4e1678305fc973823f73a5ca0c7ba6ad |
Hashes for quick_sketches-0.0.1-cp38-cp38-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ffb77c875f37f70c8d08a64b78e55f5b1aaa293a041457d523fde32614cc47fc |
|
MD5 | 9fcda28d02942d725ef814dc0da769ec |
|
BLAKE2b-256 | 900e0118512b1a05882d3f725c217d9f1337a42095a772caf58a3ae043b37af2 |
Hashes for quick_sketches-0.0.1-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d53c75cb86d75b296f6ad14477eff986ad77506f6b431d06f2c0dffd4e4e03c |
|
MD5 | dcc818c00593a5377c814bdd02434a85 |
|
BLAKE2b-256 | 6feb717a54bb41a9a8e412c32279f59d6b13bdf8b8ec234cbee7ec47a46ee4f8 |