GithubHelp home page GithubHelp logo

pombredanne / morris_counter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ikegami-yukino/morris_counter

0.0 1.0 0.0 184 KB

Memory-efficient probabilistic counter namely Morris Counter

Home Page: https://ikegami-yukino.github.io/morris_counter/

License: MIT License

Python 82.62% Makefile 9.90% Batchfile 7.49%

morris_counter's Introduction

Morris Counter

travis-ci.org pyversion latest version license

Memory-efficient probabilistic counter namely Morris Counter. This module based on the following paper:

  • Robert Morris. Counting large numbers of events in small registers. Communications of the ACM, vol. 21, issue 10, pp. 840-842, 1978.

Currently Morris Counter supports Python 3.5 and higher.

Basic idea of Morris Counter is described as follows:

INSTALLATION

$ pip install morris_counter

While the Morris Counter works builtin modules, using third-party package (numpy and mmh3) leads to improve memory-usage and computation time.

$ pip install numpy mmh3

USAGE

from morris_counter import MorrisCounter

mc = MorrisCounter(size=1000000, dtype='uint8', radix=2, seed=3282)
mc.count('ZOC')
# => 1
mc.increment('ZOC')
mc.count('ZOC')
# => 2
_ = [mc.increment('ZOC') for _ in range(2000)]
mc.count('ZOC')
# => 2048

morris_counter's People

Contributors

ikegami-yukino avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.