Cue / scales

scales - Metrics for Python
Apache License 2.0
920 stars 73 forks source link

Transliteration of Exponential Reservoir Decay #17

Closed GregBowyer closed 10 years ago

GregBowyer commented 10 years ago

The yammer / codahale metrics library implements a nice sample method that provides for exponential decay with tiny amounts of memory.

This is based on the Comode et al paper Forward Decay: A practical Time Decay Model for Streaming Streams

This hopefully provides a transliteration of the java code to scales, done with the java code in one hand, whilst glancing at the Comode paper in the other.

Acked-by: Zac Propersi logicalbomb@github.com

GregBowyer commented 10 years ago

No love for this pull request ?

PeterScott commented 10 years ago

Looks pretty sweet! A bit mathematically daunting, but sweet. :-)

I fixed a small Python 3 incompatibility, added a simple test case, and merged it in. It'll be in the next PyPI release. Thanks!